public addBehavior (Phalcon\Mvc\Model\BehaviorInterface $behavior)
Setups a behavior in a model
<?php use Phalcon\Mvc\Model; use Phalcon\Mvc\Model\Behavior\Timestampable; class Robots extends Model { public function initialize() { $this->addBehavior(new Timestampable(array( 'onCreate' => array( 'field' => 'created_at', 'format' => 'Y-m-d' ) ))); } }
Please login to continue.