/** * Create a new Mongolid model instance. * * @param array $attributes * @return void */ public function __construct(array $attributes = array()) { parent::__construct($attributes); // Set the prefix $this->prefix = \Config::get('verify-l4-mongolid::prefix', 'test'); $this->collection = $this->prefix . $this->collection; }
/** * Register the mongoLid driver in auth AuthManager * * @return void */ public function boot() { $this->extendsAuthManager(); MongoLid::setEventDispatcher($this->app['events']); }
/** * Save the model to the database if it's valid. Run beforeSave() and * afterSave() methods. * * @param $force Force save even if the object is invalid * @return bool */ public function save($force = false) { $this->beforeSave($force); $result = parent::save($force); $this->afterSave($result, $force); return $result; }
/** * * @param type $name * @param type $value * @return type */ public function __set($name, $value) { if ($name == 'password') { return $this->setPasswordAttribute($value); } else { return parent::__set($name, $value); } }