Example #1
0
 /**
  * {@inheritdoc}
  */
 public function __construct(array $data = array(), $new = true)
 {
     parent::__construct($data, $new);
     // This is needed for validation and encryption later
     if (isset($data['password'])) {
         $this->password = $data['password'];
     }
 }
Example #2
0
 public function __construct(array $data = array(), $new = true)
 {
     // call the ORM model constructor
     parent::__construct($data, $new);
     // process the model's tree properties, set some defaults if needed
     if (isset(static::$tree) and is_array(static::$tree)) {
         foreach (static::$defaults as $key => $value) {
             $this->configuration[$key] = isset(static::$tree[$key]) ? static::$tree[$key] : static::$defaults[$key];
         }
     } else {
         $this->configuration = array_merge(static::$defaults, $this->configuration);
     }
     // array of read-only column names
     foreach (array('left_field', 'right_field', 'tree_field', 'symlink_field') as $field) {
         !empty($this->configuration[$field]) and $this->readonly_fields[] = $this->configuration[$field];
     }
     if (count(static::$_primary_key) > 1) {
         throw new \Exception('The NestedSets model doesn\'t support ORM Models with multiple primary key columns.');
     }
 }
 public function __construct(array $data = array(), $new = true, $view = null, $cache = true)
 {
     parent::__construct($data, $new, $view, $cache);
     $this->app_admin_path = APPPATH . 'classes' . DS . 'controller' . DS . 'admin' . DS;
 }