Skip to content

Latest commit

 

History

History
75 lines (61 loc) · 2.31 KB

fORMDate.wiki

File metadata and controls

75 lines (61 loc) · 2.31 KB

Table of Contents

fORMDate

<<css mode="next" class="sidebar"></css>> (((

Class Resources <<toc></toc>>

 - '''<a href="/docs/fORMDate">Class Documentation</a>'''
 - <a href="/api/fORMDate">API Reference</a>
 - <a href="https://github.com/flourishlib/flourish-classes/blob/master/fORMDate.php" target="_blank">Source Code</a>

<<toc></toc>>

ORM Classes <<toc></toc>>

 - fActiveRecord
 - fRecordSet

 - fORM
 - fORMColumn
 - fORMDatabase
 - '''fORMDate'''
 - fORMFile
 - fORMJSON
 - fORMMoney
 - fORMOrdering
 - fORMRelated
 - fORMSchema
 - fORMValidation

)))

The fORMDate class is an ORM plugin to provide additional functionality for date and time columns.

Date Created Columns

The static method ::configureDateCreatedColumn() sets an active record class to automatically set a `date`, `time` or `timestamp` column to the date/time when the record is first saved in the database.

Date Updated Columns

The static method ::configureDateUpdatedColumn() sets an active record class to automatically set a `date`, `time` or `timestamp` column to the current date/time each time the record is saved in the database.

Timezone Columns

Since not all supported databases support timezone information in timestamp columns, the fORMDate class allows associating a timestamp column with another column to store the timezone name. The static method ::configureTimezoneColumn() accepts three parameters, the `$class`, the `$timestamp_column` and the `$timezone_column`.

The timezone column will be used to store the timezone stored in any fTimestamp objects that are set to the timestamp column. If a new timestamp is set, it will be combined with the existing timezone into a new fTimestamp object. The object will be stored in the timestamp column. If a new timezone is set, it will be combined with the existing timestamp and the new fTimestamp object will be stored in the timestamp column.