Пример #1
0
 /**
  * Create a new AdministratorModel instance.
  */
 public function __construct(array $attributes = array())
 {
     parent::__construct($attributes);
     if (!static::$app) {
         static::$app = app();
     }
     $this->table = 'cb_administrators';
 }
Пример #2
0
 public function delete()
 {
     if ($this->id === $this->currentUser()->id) {
         return false;
     }
     $id = $this->id;
     Activity::log(array('contentID' => $this->id, 'contentType' => 'account_deleted', 'description' => $this->id, 'details' => '', 'updated' => $this->currentUser()->id ? true : false));
     Event::fire('controller.user.delete', array($this));
     if (!parent::delete()) {
         return false;
     }
     return !$this->find($id) ? true : false;
 }
Пример #3
0
 public function setUp()
 {
     ConfideUser::$app = $this->mockApp();
     $this->confide_user = new ConfideUser();
 }
Пример #4
0
 public function afterSave($success = true, $forced = false)
 {
     if ($this->email) {
         return parent::afterSave($success = true, $forced = false);
     } else {
         return true;
     }
 }
Пример #5
0
 public function __construct(array $attributes = array())
 {
     $this->hasAttachedFile('avatar', ['styles' => ['medium' => '300x300', 'thumb' => '100x100'], 'default_url' => 'missing.png']);
     parent::__construct($attributes);
 }
Пример #6
0
 public function delete()
 {
     return parent::delete();
 }
Пример #7
0
 /**
  * Boot
  */
 public static function boot()
 {
     parent::boot();
     // self::created(function () {
     //     Cache::tags('User')->flush();
     // });
     // self::updated(function () {
     //     Cache::tags('User')->flush();
     // });
     // self::deleted(function () {
     //     Cache::tags('User')->flush();
     // });
 }