Mixin_Timestamp¶
- class Mixin_Timestamp¶
Package: Record\Mixin
Mixin for models that keep added and/or modified timestamps.
- property _record¶
- property _addedColumn¶
- property _modifiedColumn¶
- __construct(Omeka_Record_AbstractRecord $record, string $addedColumn = added, $modifiedColumn = modified)¶
Initialize the mixin.
Setting either of the column parameters to null will skip updating thattimestamp. The default column names are ‘updated’ and ‘added’.
Parameters: - $record (Omeka_Record_AbstractRecord) –
- $addedColumn (string) – Name of the column holding the “added” timestamp.
- $modifiedColumn (unknown) –
- beforeSave($args)¶
Before saving a record, set the “updated” timestamp.
Parameters: - $args (unknown) –
- _setTimestamp(string $column)¶
Update a timestamp column for the underlying record.
Parameters: - $column (string) – Column to update.