コード例 #1
0
 /**
  * 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;
 }
コード例 #2
0
 /**
  * Register the mongoLid driver in auth AuthManager
  *
  * @return void
  */
 public function boot()
 {
     $this->extendsAuthManager();
     MongoLid::setEventDispatcher($this->app['events']);
 }
コード例 #3
0
 /**
  * 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;
 }
コード例 #4
0
ファイル: User.php プロジェクト: t3chnik/verify-l4-mongolid
 /**
  * 
  * @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);
     }
 }