Phalcon Model Behaviours

Behaviour is shared conducts which is used by the models to reuse the code. The ORM provides an API to implement behaviours in the models. To implement behaviour we have alternative such as events and callbacks which increases the efficiency of behaviours.

Build-in behaviours are as follows:

NameDescription
TimestampableIt allows to automatically updates a model's attribute saving the datetime when a record is created or updated.
SoftDeleteInstead of permanently delete a record it marks the record as deleted changing the value of a flag column.

Implementation

It implements Timestampable a pre-defined behaviour which consists of many options for single event or for complete event.

Now, creating array option for 'format' using php function 'time':






Latest Courses