Overview

Packages

  • Actions
  • Codegen
  • Controls
    • Base
  • DatabaseAdapters
  • Events
  • None
  • Sessions
  • Tests

Classes

  • AbstractControl_CodeGenerator
  • AjaxTimingForm
  • BasicForm
  • BasicOrmTests
  • BBCodeParser
  • CacheTests
  • CalculatorForm
  • CalculatorWidget
  • ComplexColumn
  • DataRepeaterExample
  • Event
  • ExampleCheckColumn1
  • ExampleCheckColumn2
  • ExampleForm
  • Examples
  • ExampleService
  • ExamplesForm
  • ExampleSingleForm
  • ExpandAsArrayTests
  • HtmlJqDoc
  • InjectForm
  • JavaScriptHelper
  • JqAttributes
  • JqControlGen
  • JqDoc
  • JqIcon
  • Method
  • ModelConnectorTests
  • MyControl
  • MyQSlider_ChangeEvent
  • NavPanel
  • NestedTabForm
  • Option
  • Order
  • PaginatorForm
  • ParamsForm
  • PersistentExampleForm
  • PersonEditPanel
  • PluginEditForm
  • PluginManagerForm
  • Project
  • ProjectEditPanel
  • ProjectListForm
  • ProjectPickerListBox
  • ProjectViewPanel
  • QAbstractCacheProvider
  • QAbstractHtmlTableColumn
  • QAbstractHtmlTableDataColumn
  • QAccordion
  • QAccordion_ActivateEvent
  • QAccordion_BeforeActivateEvent
  • QAccordion_CreateEvent
  • QAccordionBase
  • QAccordionGen
  • QAction
  • QActionControl
  • QAjaxAction
  • QAjaxControlAction
  • QAjaxResponse
  • QAlertAction
  • QApplication
  • QApplicationBase
  • QArchive
  • QAutocomplete
  • QAutocomplete_ChangeEvent
  • QAutocomplete_CloseEvent
  • QAutocomplete_CodeGenerator
  • QAutocomplete_CreateEvent
  • QAutocomplete_FocusEvent
  • QAutocomplete_OpenEvent
  • QAutocomplete_ResponseEvent
  • QAutocomplete_SearchEvent
  • QAutocomplete_SelectEvent
  • QAutocomplete_SourceEvent
  • QAutocompleteBase
  • QAutocompleteBase_CodeGenerator
  • QAutocompleteGen
  • QAutocompleteListItem
  • QBackspaceKeyEvent
  • QBaseClass
  • QBlockControl
  • QBlurControlAction
  • QBlurEvent
  • QBorderCollapse
  • QBorderStyle
  • QBrowserType
  • QButton
  • QButtonBase
  • QCache
  • QCacheDeleteAction
  • QCacheDeleteAllAction
  • QCacheProviderAPC
  • QCacheProviderLocalMemory
  • QCacheProviderLocalMemoryTest
  • QCacheProviderMemcache
  • QCacheProviderNoCache
  • QCacheProviderProxy
  • QCacheSetAction
  • QCalendar
  • QCalendarType
  • QCallType
  • QCausesValidation
  • QCellClickEvent
  • QChangeEvent
  • QCheckBox
  • QCheckBox_CodeGenerator
  • QCheckBoxBase_CodeGenerator
  • QCheckBoxLegacyColumn
  • QCheckBoxList
  • QCheckBoxList_CodeGenerator
  • QCheckBoxListBase_CodeGenerator
  • QClickEvent
  • QCodeGen
  • QCodeGenBase
  • QConfirmAction
  • QContextMenuEvent
  • QControl
  • QControl_CodeGenerator
  • QControlBase
  • QControlBase_CodeGenerator
  • QControlBaseTests
  • QControlCategoryType
  • QControlGrouping
  • QControlLabel
  • QControlProxy
  • QConvertNotation
  • QConvertNotationBase
  • QCrossScripting
  • QCryptography
  • QCss
  • QCssAction
  • QCssClassAction
  • QCssTests
  • QCsvTextBox
  • QCursor
  • QDatabaseBase
  • QDatabaseCodeGen
  • QDatabaseFieldBase
  • QDatabaseFieldType
  • QDatabaseForeignKey
  • QDatabaseIndex
  • QDatabaseResultBase
  • QDatabaseRowBase
  • QDatabaseTests
  • QDataGrid
  • QDataGrid_CheckBoxColumn
  • QDataGrid_CodeGenerator
  • QDataGrid_SortEvent
  • QDataGridBase
  • QDataGridBase_CodeGenerator
  • QDataGridLegacy
  • QDataGridLegacyBase
  • QDataGridLegacyColumn
  • QDataGridLegacyRow
  • QDataGridLegacyRowStyle
  • QDataRepeater
  • QDatepicker
  • QDatepicker_BeforeShowDayEvent
  • QDatepicker_BeforeShowEvent
  • QDatepicker_CalculateWeekEvent
  • QDatepicker_ChangeMonthYearEvent
  • QDatepicker_CloseEvent
  • QDatepicker_SelectEvent
  • QDatepicker_SelectEvent2
  • QDatepickerBase
  • QDatepickerBox
  • QDatepickerBox_BeforeShowDayEvent
  • QDatepickerBox_BeforeShowEvent
  • QDatepickerBox_CalculateWeekEvent
  • QDatepickerBox_ChangeMonthYearEvent
  • QDatepickerBox_CloseEvent
  • QDatepickerBox_CodeGenerator
  • QDatepickerBox_SelectEvent
  • QDatepickerBoxBase
  • QDatepickerBoxBase_CodeGenerator
  • QDatepickerBoxGen
  • QDatepickerGen
  • QDateTime
  • QDateTimePicker
  • QDateTimePicker_CodeGenerator
  • QDateTimePickerBase_CodeGenerator
  • QDateTimePickerFormat
  • QDateTimePickerType
  • QDateTimeSpan
  • QDateTimeTests
  • QDateTimeTextBox
  • QDbBackedFormStateHandler
  • QDbBackedSessionHandler
  • QDialog
  • QDialog_BeforeCloseEvent
  • QDialog_ButtonEvent
  • QDialog_CloseEvent
  • QDialog_CreateEvent
  • QDialog_DragEvent
  • QDialog_DragStartEvent
  • QDialog_DragStopEvent
  • QDialog_FocusEvent
  • QDialog_OpenEvent
  • QDialog_ResizeEvent
  • QDialog_ResizeStartEvent
  • QDialog_ResizeStopEvent
  • QDialogBase
  • QDialogBox
  • QDialogGen
  • QDisplayStyle
  • QDoubleClickEvent
  • QDownArrowKeyEvent
  • QDragDropEvent
  • QDraggable
  • QDraggable_CreateEvent
  • QDraggable_DragEvent
  • QDraggable_StartEvent
  • QDraggable_StopEvent
  • QDraggableBase
  • QDraggableGen
  • QDroppable
  • QDroppable_ActivateEvent
  • QDroppable_CreateEvent
  • QDroppable_DeactivateEvent
  • QDroppable_DropEvent
  • QDroppable_OutEvent
  • QDroppable_OverEvent
  • QDroppableBase
  • QDroppableGen
  • QDropZoneGrouping
  • QEmailAttachment
  • QEmailMessage
  • QEmailServer
  • QEmailStringAttachment
  • QEmailTextBox
  • QEnterKeyEvent
  • QErrorAttribute
  • QEscapeKeyEvent
  • QEvent
  • QFieldset
  • QFile
  • QFileAsset
  • QFileAssetBase
  • QFileAssetDialog
  • QFileAssetType
  • QFileControl
  • QFileFormStateHandler
  • QFilterType
  • QFloatTextBox
  • QFloatTextBox_CodeGenerator
  • QFloatTextBoxBase_CodeGenerator
  • QFocusControlAction
  • QFocusEvent
  • QFocusInEvent
  • QFocusOutEvent
  • QFolder
  • QFontFamily
  • QForm
  • QFormBase
  • QFormGen
  • QFormStateHandler
  • QGridLines
  • QHideCalendarAction
  • QHideDialog
  • QHideDialogBox
  • QHListControl
  • QHListItem
  • QHorizontalAlign
  • QHtml
  • QHtmlAttributeManager
  • QHtmlAttributeManagerBase
  • QHtmlReporter
  • QHtmlTable
  • QHtmlTable_CodeGenerator
  • QHtmlTableBase
  • QHtmlTableCallableColumn
  • QHtmlTableCheckBoxColumn
  • QHtmlTableCheckBoxColumn_ClickEvent
  • QHtmlTableIndexedColumn
  • QHtmlTableLinkColumn
  • QHtmlTableNodeColumn
  • QHtmlTablePropertyColumn
  • QI18n
  • QI18nTests
  • QImageBase
  • QImageBrowser
  • QImageBrowserBase
  • QImageBrowserNav
  • QImageBrowserThumbnails
  • QImageButton
  • QImageControl
  • QImageControlBase
  • QImageFileAsset
  • QImageLabel
  • QImageLabelBase
  • QImageRollover
  • QImageType
  • QIndex
  • QInformixPdoDatabase
  • QInformixPdoDatabaseField
  • QInformixPdoDatabaseResult
  • QInformixPdoDatabaseRow
  • QInputEvent
  • QInstallationValidationResult
  • QInstallationValidator
  • QIntegerTextBox
  • QIntegerTextBox_CodeGenerator
  • QIntegerTextBoxBase_CodeGenerator
  • QJavaScriptAction
  • QJQAction
  • QJQBounceAction
  • QJqButton
  • QJqButton_CreateEvent
  • QJqButtonBase
  • QJqButtonGen
  • QJqCheckBox
  • QJqCheckBox_CreateEvent
  • QJqCheckBoxBase
  • QJqCheckBoxGen
  • QJQHideAction
  • QJQHideEffectAction
  • QJQHighlightAction
  • QJQPulsateAction
  • QJqRadioButton
  • QJqRadioButton_CreateEvent
  • QJqRadioButtonBase
  • QJqRadioButtonGen
  • QJQShakeAction
  • QJQShowAction
  • QJQShowEffectAction
  • QJQSizeAction
  • QJQToggleAction
  • QJQToggleEffectAction
  • QJQTransferAction
  • QJqUiEvent
  • QJqUiPropertyEvent
  • QJsClosure
  • QJsFunction
  • QJsNoQuoteKey
  • QJsParameterList
  • QJsPriority
  • QJsTimer
  • QJsTimerBase
  • QJsVarName
  • QKeyDownEvent
  • QKeyPressEvent
  • QKeyUpEvent
  • QLabel
  • QLabel_CodeGenerator
  • QLabelBase_CodeGenerator
  • QLexer
  • QLinkButton
  • QListBox
  • QListBox_CodeGenerator
  • QListBoxBase
  • QListBoxBase_CodeGenerator
  • QListControl
  • QListControl_CodeGenerator
  • QListControlBase_CodeGenerator
  • QListItem
  • QListItemBase
  • QListItemStyle
  • QManyToManyReference
  • QMenu
  • QMenu_BlurEvent
  • QMenu_CreateEvent
  • QMenu_FocusEvent
  • QMenu_SelectEvent
  • QMenuBase
  • QMenuGen
  • QMimeType
  • QModelConnectorArgumentType
  • QModelConnectorCreateType
  • QModelConnectorEditDlg
  • QModelConnectorOptions
  • QModelConnectorParam
  • QMouseDownEvent
  • QMouseEnterEvent
  • QMouseLeaveEvent
  • QMouseMoveEvent
  • QMouseOutEvent
  • QMouseOverEvent
  • QMouseUpEvent
  • QMultiLevelCacheProvider
  • QMySqlDatabase
  • QMySqlDatabaseField
  • QMySqlDatabaseResult
  • QMySqli5ClusterDatabase
  • QMySqli5Database
  • QMySqli5DatabaseField
  • QMySqli5DatabaseResult
  • QMySqliDatabase
  • QMySqliDatabaseField
  • QMySqliDatabaseResult
  • QMySqliDatabaseRow
  • QNoScriptAjaxAction
  • QNumericTextBox
  • QOnEvent
  • QOracleDatabase
  • QOracleDatabaseField
  • QOracleDatabaseResult
  • QOracleDatabaseRow
  • QOrderedListType
  • QOverflow
  • QPaginatedControl
  • QPaginator
  • QPaginatorBase
  • QPanel
  • QPartialQueryBuilder
  • QPdoDatabase
  • QPdoDatabaseResult
  • QPgConditionILike
  • QPgConditionJsonContains
  • QPgQ
  • QPosition
  • QPostgreSqlDatabase
  • QPostgreSqlDatabaseField
  • QPostgreSqlDatabaseResult
  • QPostgreSqlDatabaseRow
  • QPostgreSqlPdoDatabase
  • QPostgreSqlPdoDatabaseField
  • QPostgreSqlPdoDatabaseResult
  • QPostgreSqlPdoDatabaseRow
  • QProgressbar
  • QProgressbar_ChangeEvent
  • QProgressbar_CompleteEvent
  • QProgressbar_CreateEvent
  • QProgressbarBase
  • QProgressbarGen
  • QQ
  • QQAggregationClause
  • QQAliasTests
  • QQAssociationNode
  • QQAverage
  • QQClause
  • QQColumnNode
  • QQCondition
  • QQConditionAll
  • QQConditionAnd
  • QQConditionBetween
  • QQConditionComparison
  • QQConditionEqual
  • QQConditionExists
  • QQConditionGreaterOrEqual
  • QQConditionGreaterThan
  • QQConditionIn
  • QQConditionIsNotNull
  • QQConditionIsNull
  • QQConditionLessOrEqual
  • QQConditionLessThan
  • QQConditionLike
  • QQConditionLogical
  • QQConditionNone
  • QQConditionNot
  • QQConditionNotBetween
  • QQConditionNotEqual
  • QQConditionNotExists
  • QQConditionNotIn
  • QQConditionNotLike
  • QQConditionOr
  • QQCount
  • QQDistinct
  • QQExpand
  • QQExpandAsArray
  • QQExpandVirtualNode
  • QQFuncTests
  • QQFunctionNode
  • QQGroupBy
  • QQHavingClause
  • QQLimitInfo
  • QQMathNode
  • QQMathOpTests
  • QQMaximum
  • QQMinimum
  • QQNamedValue
  • QQNode
  • QQNoParentNode
  • QQOrderBy
  • QQReverseReferenceNode
  • QQSelect
  • QQSubQueryCountNode
  • QQSubQueryNode
  • QQSubQuerySqlNode
  • QQSum
  • QQTableNode
  • QQuery
  • QQueryBuilder
  • QQueryExpansion
  • QQVirtualNode
  • QRadioButton
  • QRadioButtonList
  • QRadioButtonList_CodeGenerator
  • QRadioButtonListBase_CodeGenerator
  • QRedirectAction
  • QReference
  • QRegex
  • QRegisterClickPositionAction
  • QRepeatDirection
  • QRequestMode
  • QResetTimerAction
  • QResizable
  • QResizable_CreateEvent
  • QResizable_ResizeEvent
  • QResizable_StartEvent
  • QResizable_StopEvent
  • QResizableBase
  • QResizableGen
  • QResizeHandleDirection
  • QRestServiceCodeGen
  • QReverseReference
  • QRssCategory
  • QRssFeed
  • QRssImage
  • QRssItem
  • QSampleControl
  • QSampleTranslation
  • QSelectable
  • QSelectable_CreateEvent
  • QSelectable_SelectedEvent
  • QSelectable_SelectingEvent
  • QSelectable_StartEvent
  • QSelectable_StopEvent
  • QSelectable_UnselectedEvent
  • QSelectable_UnselectingEvent
  • QSelectableBase
  • QSelectableGen
  • QSelectControlAction
  • QSelectEvent
  • QSelectionMode
  • QSelectMenu
  • QSelectMenu_ChangeEvent
  • QSelectMenu_CloseEvent
  • QSelectMenu_CreateEvent
  • QSelectMenu_FocusEvent
  • QSelectMenu_OpenEvent
  • QSelectMenu_SelectEvent
  • QSelectMenuBase
  • QSelectMenuGen
  • QServerAction
  • QServerControlAction
  • QSessionFormStateHandler
  • QSetValueAction
  • QShowCalendarAction
  • QShowDialog
  • QShowDialogBox
  • QSlider
  • QSlider_ChangeEvent
  • QSlider_CodeGenerator
  • QSlider_CreateEvent
  • QSlider_SlideEvent
  • QSlider_StartEvent
  • QSlider_StopEvent
  • QSliderBase
  • QSliderBase_CodeGenerator
  • QSliderGen
  • QSoapMethod
  • QSoapParameter
  • QSoapService
  • QSortable
  • QSortable_ActivateEvent
  • QSortable_BeforeStopEvent
  • QSortable_ChangeEvent
  • QSortable_CreateEvent
  • QSortable_DeactivateEvent
  • QSortable_OutEvent
  • QSortable_OverEvent
  • QSortable_ReceiveEvent
  • QSortable_RemoveEvent
  • QSortable_SortEvent
  • QSortable_StartEvent
  • QSortable_StopEvent
  • QSortable_UpdateEvent
  • QSortableBase
  • QSortableGen
  • QSpinner
  • QSpinner_ChangeEvent
  • QSpinner_CreateEvent
  • QSpinner_SpinEvent
  • QSpinner_StartEvent
  • QSpinner_StopEvent
  • QSpinnerBase
  • QSpinnerGen
  • QSqlColumn
  • QSqLite3PdoDatabase
  • QSqLite3PdoDatabaseField
  • QSqLite3PdoDatabaseResult
  • QSqLite3PdoDatabaseRow
  • QSqlServer2005Database
  • QSqlServer2005DatabaseField
  • QSqlServer2005DatabaseResult
  • QSqlServer2005DatabaseRow
  • QSqlServerDatabase
  • QSqlServerDatabaseField
  • QSqlServerDatabaseResult
  • QSqlServerDatabaseRow
  • QSqlTable
  • QStack
  • QStopPropagationAction
  • QString
  • QStringTest
  • QTabKeyEvent
  • QTabs
  • QTabs_ActivateEvent
  • QTabs_BeforeActivateEvent
  • QTabs_BeforeLoadEvent
  • QTabs_CreateEvent
  • QTabs_LoadEvent
  • QTabsBase
  • QTabsGen
  • QTag
  • QTagStyler
  • QTerminateAction
  • QTestControl
  • QTestForm
  • QTextAlign
  • QTextBox
  • QTextBox_CodeGenerator
  • QTextBoxBase
  • QTextBoxBase_CodeGenerator
  • QTextMode
  • QTimer
  • QTimerExpiredEvent
  • QTimerTests
  • QToggleCssClassAction
  • QToggleDisplayAction
  • QToggleEnableAction
  • QTranslationPoParser
  • QTreeNav
  • QTreeNavItem
  • QType
  • QTypeTable
  • QTypeTests
  • QUnitTestCaseBase
  • QUnorderedListStyle
  • QUpArrowKeyEvent
  • QUrlTextBox
  • QVerticalAlign
  • QVirtualAttributeColumn
  • QWaitIcon
  • QWatcher
  • QWatcherBase
  • QWatcherCache
  • QWatcherDB
  • QWatcherNone
  • QWriteBox
  • RecordsSummary
  • RefreshForm
  • SampleComposite
  • SampleForm
  • SelectableLabel
  • SelectForm
  • SpeedForm
  • TestImageBrowser
  • UrlForm

Interfaces

  • ICacheAction
  • QDataList_CodeGenerator_Interface
  • QTranslationBase

Traits

  • QDataBinder
  • QListItemManager
  • QModelTrait

Exceptions

  • QCallerException
  • QCrossScriptingException
  • QCryptographyException
  • QDatabaseExceptionBase
  • QDataBindException
  • QDateTimeNullException
  • QEmailException
  • QIndexOutOfRangeException
  • QInformixPdoDatabaseException
  • QInvalidCastException
  • QInvalidFormStateException
  • QMySqliDatabaseException
  • QOptimisticLockingException
  • QOracleDatabaseException
  • QPdoDatabaseException
  • QPoParserException
  • QPostgreSqlDatabaseException
  • QPostgreSqlPdoDatabaseException
  • QRemoteAdminDeniedException
  • QSqLite3PdoDatabaseException
  • QSqlServer2005DatabaseException
  • QSqlServerDatabaseException
  • QUndefinedMethodException
  • QUndefinedPrimaryKeyException
  • QUndefinedPropertyException

Functions

  • __database_check_error
  • __QForm_EvaluateTemplate_ObHandler
  • _b
  • _indent
  • _nl
  • _p
  • _r
  • _t
  • _tp
  • _tr
  • array_trim
  • beginsWith
  • CamelCaseFromDash
  • CastToInt
  • DataGridEvalHandleError
  • DisplayMonospacedText
  • endsWith
  • GO_BACK
  • jq_anytime_gen
  • jq_control_gen
  • jq_inc_gen
  • jq_indent
  • PrintExplainStatement
  • PrintInstructions
  • QcubedHandleCodeGenParseError
  • QcubedHandleError
  • QcubedHandleException
  • QCubedShutdown
  • QDateTimeErrorHandler
  • trimOffEnd
  • trimOffFront
  • Overview
  • Package
  • Class
  1: <?php
  2: 
  3:     /**
  4:      * Class QDateTimeSpan: This class is used to calculate the time difference between two dates (including time)
  5:      *
  6:      * @property-read int $Years   Years in the calculated timespan
  7:      * @property-read int $Months  Months in the calculated timespan
  8:      * @property-read int $Days    Days in the calculated timespan
  9:      * @property-read int $Hours   Hours in the calculated timespan
 10:      * @property-read int $Minutes Minutes in the calculated timespan
 11:      * @property int      $Seconds Number seconds which correspond to the time difference
 12:      */
 13:     class QDateTimeSpan extends QBaseClass{
 14:         /** @var int Seconds variable which will be used to calculate the timespan */
 15:         protected $intSeconds;
 16: 
 17:         /* From: http://tycho.usno.navy.mil/leapsec.html:
 18:             This definition was ratified by the Eleventh General Conference on Weights and Measures in 1960.
 19:             Reference to the year 1900  does not mean that this is the epoch of a mean solar day of 86,400 seconds.
 20:             Rather, it is the epoch of the tropical year of 31,556,925.9747 seconds of ephemeris time.
 21:             Ephemeris Time (ET) was defined as the measure of time that brings the observed positions of the celestial
 22:             bodies into accord with the Newtonian dynamical theory of motion.
 23:         */
 24:         /** Number of seconds in an year */
 25:         const SecondsPerYear    = 31556926;
 26:         
 27:         // Assume 30 Days per Month
 28:         /** Number of seconds in a month (assuming 30 days in a month) */
 29:         const SecondsPerMonth   = 2592000;
 30:         /** Number of seconds per day */
 31:         const SecondsPerDay     = 86400;
 32:         /** Number of seconds in an hour */
 33:         const SecondsPerHour    = 3600;
 34:         /** Number of seconds per minute */
 35:         const SecondsPerMinute  = 60;
 36: 
 37:         /**
 38:          * Constructor for the QDateTimeSpan class
 39:          *
 40:          * @param int $intSeconds Number of seconds to set for this QDateTimeSpan
 41:          */
 42:         public function __construct($intSeconds = 0) {
 43:             $this->intSeconds = $intSeconds;
 44:         }
 45: 
 46:         /*
 47:             Is functions
 48:         */ 
 49:         
 50:         /**
 51:          * Checks if the current DateSpan is positive
 52:          *
 53:          * @return boolean
 54:          */
 55:         public function IsPositive(){
 56:             return ($this->intSeconds > 0);
 57:         }
 58: 
 59:         /**
 60:          * Checks if the current DateSpan is negative
 61:          *
 62:          * @return boolean
 63:          */
 64:         public function IsNegative(){
 65:             return ($this->intSeconds < 0);
 66:         }
 67: 
 68:         /**
 69:          * Checks if the current DateSpan is zero
 70:          *
 71:          * @return boolean
 72:          */
 73:         public function IsZero(){
 74:             return ($this->intSeconds == 0);
 75:         }
 76:         
 77:         /**
 78:          * Calculates the difference between this DateSpan and another DateSpan
 79:          *
 80:          * @param QDateTimeSpan $dtsSpan
 81:          * @return new QDateTimeSpan
 82:          */
 83:         public function Difference(QDateTimeSpan $dtsSpan){
 84:             $intDifference = $this->Seconds - $dtsSpan->Seconds;
 85:             $dtsDateSpan = new QDateTimeSpan();
 86:             $dtsDateSpan->AddSeconds($intDifference);
 87:             return $dtsDateSpan;
 88:         }
 89:         
 90:         /*
 91:             SetFrom methods
 92:         */
 93:         
 94:         /**
 95:          * Sets current QDateTimeSpan to the difference between two QDateTime objects
 96:          *
 97:          * @param QDateTime $dttFrom
 98:          * @param QDateTime $dttTo
 99:          */
100:         public function SetFromQDateTime(QDateTime $dttFrom, QDateTime $dttTo){
101:             $this->Add($dttFrom->Difference($dttTo));
102:         }
103:         
104:         /*
105:             Add methods
106:         */  
107:         
108:         /**
109:          * Adds an amount of seconds to the current QDateTimeSpan
110:          *
111:          * @param int $intSeconds
112:          */
113:         public function AddSeconds($intSeconds){
114:             $this->intSeconds = $this->intSeconds + $intSeconds;
115:         }
116:         
117:         /**
118:          * Adds an amount of minutes to the current QDateTimeSpan
119:          *
120:          * @param int $intMinutes
121:          */
122:         public function AddMinutes($intMinutes){
123:             $this->intSeconds = $this->intSeconds + ($intMinutes * QDateTimeSpan::SecondsPerMinute);
124:         }
125:         
126:         /**
127:          * Adds an amount of hours to the current QDateTimeSpan
128:          *
129:          * @param int $intHours
130:          */
131:         public function AddHours($intHours){
132:             $this->intSeconds = $this->intSeconds + ($intHours * QDateTimeSpan::SecondsPerHour);
133:         }
134:         
135:         /**
136:          * Adds an amount of days to the current QDateTimeSpan
137:          *
138:          * @param int $intDays
139:          */
140:         public function AddDays($intDays){
141:             $this->intSeconds = $this->intSeconds + ($intDays * QDateTimeSpan::SecondsPerDay);
142:         }
143:         
144:         /**
145:          * Adds an amount of months to the current QDateTimeSpan
146:          *
147:          * @param int $intMonths
148:          */
149:         public function AddMonths($intMonths){
150:             $this->intSeconds = $this->intSeconds + ($intMonths * QDateTimeSpan::SecondsPerMonth);
151:         }
152:         
153:         /* 
154:             Get methods
155:         */
156:         
157:         /**
158:          * Calculates the total whole years in the current QDateTimeSpan
159:          *
160:          * @return int
161:          */
162:         protected function GetYears() {
163:             $intSecondsPerYear = ($this->IsPositive()) ? QDateTimeSpan::SecondsPerYear : ((-1) * QDateTimeSpan::SecondsPerYear);
164:             $intYears = floor($this->intSeconds / $intSecondsPerYear);
165:             if ($this->IsNegative()) $intYears = (-1) * $intYears;
166:             return $intYears;
167:         }
168: 
169:         /**
170:          * Calculates the total whole months in the current QDateTimeSpan
171:          *
172:          * @return int
173:          */
174:         protected function GetMonths(){
175:             $intSecondsPerMonth = ($this->IsPositive()) ? QDateTimeSpan::SecondsPerMonth : ((-1) * QDateTimeSpan::SecondsPerMonth);
176:             $intMonths = floor($this->intSeconds / $intSecondsPerMonth);
177:             if($this->IsNegative()) $intMonths = (-1) * $intMonths;
178:             return $intMonths;
179:         }
180:         
181:         /**
182:          * Calculates the total whole days in the current QDateTimeSpan
183:          *
184:          * @return int
185:          */
186:         protected function GetDays(){
187:             $intSecondsPerDay = ($this->IsPositive()) ? QDateTimeSpan::SecondsPerDay : ((-1) * QDateTimeSpan::SecondsPerDay);
188:             $intDays = floor($this->intSeconds / $intSecondsPerDay);
189:             if($this->IsNegative()) $intDays = (-1) * $intDays;
190:             return $intDays;
191:         }
192: 
193:         /**
194:          * Calculates the total whole hours in the current QDateTimeSpan
195:          *
196:          * @return int
197:          */
198:         protected function GetHours(){
199:             $intSecondsPerHour = ($this->IsPositive()) ? QDateTimeSpan::SecondsPerHour : ((-1) * QDateTimeSpan::SecondsPerHour);
200:             $intHours = floor($this->intSeconds / $intSecondsPerHour);
201:             if($this->IsNegative()) $intHours = (-1) * $intHours;
202:             return $intHours;
203:         }
204:         
205:         /**
206:          * Calculates the total whole minutes in the current QDateTimeSpan
207:          *
208:          * @return int
209:          */
210:         protected function GetMinutes(){
211:             $intSecondsPerMinute = ($this->IsPositive()) ? QDateTimeSpan::SecondsPerMinute : ((-1) * QDateTimeSpan::SecondsPerMinute);
212:             $intMinutes = floor($this->intSeconds / $intSecondsPerMinute);
213:             if($this->IsNegative()) $intMinutes = (-1) * $intMinutes;
214:             return $intMinutes;
215:         } 
216:         
217:         /*
218:             DateMathSettings
219:         */
220:         
221:         /**
222:          * Adds a QDateTimeSpan to current QDateTimeSpan
223:          *
224:          * @param QDateTimeSpan $dtsSpan
225:          */
226:         public function Add(QDateTimeSpan $dtsSpan){
227:             $this->intSeconds = $this->intSeconds + $dtsSpan->Seconds;
228:         }
229:         
230:         /**
231:          * Subtracts a QDateTimeSpan to current QDateTimeSpan
232:          *
233:          * @param QDateTimeSpan $dtsSpan
234:          */
235:         public function Subtract(QDateTimeSpan $dtsSpan){
236:             $this->intSeconds = $this->intSeconds - $dtsSpan->Seconds;
237:         }
238: 
239:         /**
240:          * Returns the time difference in approximate duration
241:          * e.g. "about 4 months" or "4 minutes"
242:          *
243:          * The QDateTime class uses this function in its 'Age' property accessor
244:          *
245:          * @return null|string
246:          */
247:         public function SimpleDisplay(){
248:             $arrTimearray = $this->GetTimearray();
249:             $strToReturn = null;
250: 
251:             if($arrTimearray['Years'] != 0) {
252:                 $strFormat = ($arrTimearray['Years'] != 1) ? QApplication::Translate('about %s years') :  QApplication::Translate('a year');
253:                 $strToReturn = sprintf($strFormat, $arrTimearray['Years']);
254:             }
255:             elseif($arrTimearray['Months'] != 0){
256:                 $strFormat = ($arrTimearray['Months'] != 1) ? QApplication::Translate('about %s months') : QApplication::Translate('a month');
257:                 $strToReturn = sprintf($strFormat,$arrTimearray['Months']);
258:             }
259:             elseif($arrTimearray['Days'] != 0){
260:                 $strFormat = ($arrTimearray['Days'] != 1) ? QApplication::Translate('about %s days') : QApplication::Translate('a day');
261:                 $strToReturn = sprintf($strFormat,$arrTimearray['Days']);
262:             }
263:             elseif($arrTimearray['Hours'] != 0){
264:                 $strFormat = ($arrTimearray['Hours'] != 1) ? QApplication::Translate('about %s hours') : QApplication::Translate('an hour');
265:                 $strToReturn = sprintf($strFormat,$arrTimearray['Hours']);
266:             }
267:             elseif($arrTimearray['Minutes'] != 0){
268:                 $strFormat = ($arrTimearray['Minutes'] != 1) ? QApplication::Translate('%s minutes') : QApplication::Translate('a minute');
269:                 $strToReturn = sprintf($strFormat,$arrTimearray['Minutes']);
270:             }
271:             elseif($arrTimearray['Seconds'] != 0 ){
272:                 $strFormat = ($arrTimearray['Seconds'] != 1) ? QApplication::Translate('%s seconds') : QApplication::Translate('a second');
273:                 $strToReturn = sprintf($strFormat,$arrTimearray['Seconds']);
274:             }
275:             
276:             return $strToReturn;
277:         }
278:         
279:         
280:         /**
281:          * Return an array of timeunints
282:          *
283:          * @return array of timeunits
284:          */
285:         protected function GetTimearray(){
286:             $intSeconds = abs($this->intSeconds);
287: 
288:             $intYears = floor($intSeconds / QDateTimeSpan::SecondsPerYear);
289:             $intSeconds = $intSeconds - ($intYears * QDateTimeSpan::SecondsPerYear);
290: 
291:             $intMonths = floor($intSeconds / QDateTimeSpan::SecondsPerMonth);
292:             $intSeconds = $intSeconds - ($intMonths * QDateTimeSpan::SecondsPerMonth);
293: 
294:             $intDays = floor($intSeconds / QDateTimeSpan::SecondsPerDay);
295:             $intSeconds = $intSeconds - ($intDays * QDateTimeSpan::SecondsPerDay);
296:             
297:             $intHours = floor($intSeconds / QDateTimeSpan::SecondsPerHour);
298:             $intSeconds = $intSeconds - ($intHours * QDateTimeSpan::SecondsPerHour);
299:             
300:             $intMinutes = floor($intSeconds / QDateTimeSpan::SecondsPerMinute);
301:             $intSeconds = $intSeconds - ($intMinutes * QDateTimeSpan::SecondsPerMinute);
302: 
303:             if($this->IsNegative()){
304:                 // Turn values to negative
305:                 $intYears = ((-1) * $intYears);
306:                 $intMonths = ((-1) * $intMonths);
307:                 $intDays = ((-1) * $intDays);
308:                 $intHours = ((-1) * $intHours);
309:                 $intMinutes = ((-1) * $intMinutes);
310:                 $intSeconds = ((-1) * $intSeconds);
311:             }
312: 
313:             return array('Years' => $intYears, 'Months' => $intMonths, 'Days' => $intDays, 'Hours' => $intHours, 'Minutes' => $intMinutes,'Seconds' => $intSeconds);
314:         }
315: 
316:         /**
317:          * Override method to perform a property "Get"
318:          * This will get the value of $strName
319:          * PHP magic method
320:          *
321:          * @param string $strName Name of the property to get
322:          *
323:          * @return mixed the returned property
324:          * @throws Exception|QCallerException
325:          */
326:         
327:         public function __get($strName) {
328:             switch ($strName) {
329:                 case 'Years': return $this->GetYears();
330:                 case 'Months': return $this->GetMonths();
331:                 case 'Days': return $this->GetDays();
332:                 case 'Hours': return $this->GetHours();
333:                 case 'Minutes': return $this->GetMinutes();
334:                 case 'Seconds': return $this->intSeconds;
335:                 case 'Timearray' : return ($this->GetTimearray());
336: 
337:                 default:
338:                     try {
339:                         return parent::__get($strName);
340:                     } catch (QCallerException $objExc) {
341:                         $objExc->IncrementOffset();
342:                         throw $objExc;
343:                     }
344:             }
345:         }
346: 
347:         /**
348:          * Override method to perform a property "Set"
349:          * This will set the property $strName to be $mixValue
350:          * PHP magic method
351:          *
352:          * @param string $strName  Name of the property to set
353:          * @param string $mixValue New value of the property
354:          *
355:          * @return mixed the property that was set
356:          * @throws Exception|QCallerException
357:          */
358:     
359:         public function __set($strName, $mixValue) {
360:             try {
361:                 switch ($strName) {
362:                     case 'Seconds':
363:                         return ($this->intSeconds = QType::Cast($mixValue, QType::Integer));
364:                     default:
365:                         return (parent::__set($strName, $mixValue));
366:                 }               
367:             } catch (QCallerException $objExc) {
368:                 $objExc->IncrementOffset();
369:                 throw $objExc;
370:             }
371:         }
372:     }
API documentation generated by ApiGen