Mixin_Timestamp

Package: Record\Mixin

class Mixin_Timestamp

extends Omeka_Record_Mixin_AbstractMixin

Mixin for models that keep added and/or modified timestamps.

property Mixin_Timestamp::$_record

protected

property Mixin_Timestamp::$_addedColumn

protected

property Mixin_Timestamp::$_modifiedColumn

protected

Mixin_Timestamp::__construct($record, $addedColumn = 'added', $modifiedColumn = 'modified')

Initialize the mixin.

Setting either of the column parameters to null will skip updating that timestamp. The default column names are ‘updated’ and ‘added’.

Parameters:
  • $record (Omeka_Record_AbstractRecord) –

  • $addedColumn (string) – Name of the column holding the “added” timestamp.

  • $modifiedColumn

Mixin_Timestamp::beforeSave($args)

Before saving a record, set the “updated” timestamp.

Parameters:
  • $args

Mixin_Timestamp::_setTimestamp($column)

Update a timestamp column for the underlying record.

Parameters:
  • $column (string) – Column to update.