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'); }
/** * @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); } } }