interface DateTimeInterface (View source)

Interface for the ActiveRecord\DateTime class so that ActiveRecord\Model->assign_attribute() will know to call attribute_of() on passed values. This is so the DateTime object can flag the model as dirty via $model->flag_dirty() when one of its setters is called.

Methods

void
attribute_of(Model $model, string $attribute_name)

Indicates this object is an attribute of the specified model, with the given attribute name.

format($format = null)

Formats the DateTime to the specified format.

static 
createFromFormat($format, $time, $tz = null)

See http://php.net/manual/en/datetime.createfromformat.php

Details

void attribute_of(Model $model, string $attribute_name)

Indicates this object is an attribute of the specified model, with the given attribute name.

Parameters

Model $model The model this object is an attribute of
string $attribute_name The attribute name

Return Value

void

format($format = null)

Formats the DateTime to the specified format.

Parameters

$format

static createFromFormat($format, $time, $tz = null)

See http://php.net/manual/en/datetime.createfromformat.php

Parameters

$format
$time
$tz