UpdatedAt observer.

Makes sure the updated timestamp column in a Model record gets a value when a record is updated in the database.

 Methods

Set the properties for this observer instance, based on the parent model's configuration or the defined defaults.

__construct(string $class) 

Parameters

$class

string

Model class this observer is called on

Set the UpdatedAt property to the current time.

before_save(\Orm\Model $obj) 

Parameters

$obj

\Orm\Model

Model object subject of this observer method

Set the UpdatedAt property to the current time.

before_update(\Orm\Model $obj) 

Parameters

$obj

\Orm\Model

Model object subject of this observer method

Create an instance of this observer

instance(string $model_class) 
Inherited

inherited_from \Orm\Observer::instance()

Parameters

$model_class

string

name of the model class

Get notified of an event

orm_notify(\Orm\Model $instance, string $event) 
Inherited

inherited_from \Orm\Observer::orm_notify()

Parameters

$instance

\Orm\Model

$event

string

 Properties

 

<p>set true to use mySQL timestamp instead of UNIX timestamp</p>

$mysql_timestamp : bool

 

<p>property to set the timestamp on</p>

$property : string