Example #1
0
 /**
  * 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'));
 }
Example #2
0
 /**
  * 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());
 }
Example #3
0
 /**
  * Constructor
  *
  * @param mixed $attributes
  *
  * @return BaseModel
  */
 public function __construct($attributes = null)
 {
     ModelHelper::populateAttributeDefaults($this);
     $this->setAttributes($attributes);
     $this->attachBehaviors($this->behaviors());
 }
Example #4
0
 /**
  * Constructor
  *
  * @param mixed $attributes
  */
 function __construct($attributes = null)
 {
     ModelHelper::populateAttributeDefaults($this);
     $this->setAttributes($attributes);
 }