Example #1
0
 public function __construct($options)
 {
     $this->options = array_merge($this->options, $options);
     $this->Session = Session::getInstance();
     $this->db = Orm::loadModel('Users');
     $this->options['salt'] = Configure::get('globals.salt');
 }
Example #2
0
 /**
  * @param $model
  */
 public function loadModel($model)
 {
     if (is_array($model)) {
         foreach ($model as $k => $v) {
             if (Orm::modelExist($v)) {
                 $this->{$v} = Orm::loadModel($v);
             }
         }
     } else {
         if (Orm::modelExist($model)) {
             $this->{$model} = Orm::loadModel($model);
         }
     }
 }