/** * Initializes the application component. * * @return null */ public function init() { ModelHelper::populateAttributeDefaults($this); $this->attachEventHandler('onAfterFind', array($this, 'prepAttributesForUse')); $this->attachEventHandler('onBeforeSave', array($this, 'prepAttributesForSave')); $this->attachEventHandler('onAfterSave', array($this, 'prepAttributesForUse')); }
/** * Constructor * * @param mixed $attributes * * @return BaseModel */ public function __construct($attributes = null) { if (!$this->strictAttributes) { $this->_extraAttributeNames = array(); } ModelHelper::populateAttributeDefaults($this); $this->setAttributes($attributes); $this->attachBehaviors($this->behaviors()); }
/** * Constructor * * @param mixed $attributes * * @return BaseModel */ public function __construct($attributes = null) { ModelHelper::populateAttributeDefaults($this); $this->setAttributes($attributes); $this->attachBehaviors($this->behaviors()); }
/** * Constructor * * @param mixed $attributes */ function __construct($attributes = null) { ModelHelper::populateAttributeDefaults($this); $this->setAttributes($attributes); }