コード例 #1
0
ファイル: Block.php プロジェクト: aekkapun/luya
 /**
  * Search for entries with cached block id in cms_nav_item_page_block_item and delete them
  */
 public function afterDelete()
 {
     if ($this->cachedDeletedId) {
         foreach (NavItemPageBlockItem::find()->where(['block_id' => $this->cachedDeletedId])->all() as $item) {
             $item->delete();
         }
     }
     parent::afterDelete();
 }
コード例 #2
0
ファイル: StorageFilter.php プロジェクト: boehsermoe/luya
 public function beforeDelete()
 {
     if (parent::beforeDelete()) {
         foreach (StorageImage::find()->where(['filter_id' => $this->id])->all() as $img) {
             $img->delete();
         }
         return true;
     }
     return false;
 }
コード例 #3
0
ファイル: Cat.php プロジェクト: gitter-badger/luya
 public function init()
 {
     parent::init();
     $this->on(self::EVENT_BEFORE_DELETE, [$this, 'eventBeforeDelete']);
 }
コード例 #4
0
ファイル: Article.php プロジェクト: gitter-badger/luya
 public function init()
 {
     parent::init();
     $this->on(self::EVENT_BEFORE_INSERT, [$this, 'eventBeforeInsert']);
     $this->on(self::EVENT_BEFORE_UPDATE, [$this, 'eventBeforeUpdate']);
 }
コード例 #5
0
ファイル: User.php プロジェクト: krystian-thiede/luya
 public function init()
 {
     parent::init();
     $this->on(self::EVENT_BEFORE_INSERT, [$this, 'encodePassword']);
 }
コード例 #6
0
ファイル: User.php プロジェクト: aekkapun/luya
 public function fields()
 {
     $fields = parent::fields();
     unset($fields['password'], $fields['password_salt'], $fields['auth_token'], $fields['is_deleted']);
     return $fields;
 }
コード例 #7
0
ファイル: Lang.php プロジェクト: gitter-badger/luya
 public function init()
 {
     parent::init();
     $this->on(self::EVENT_BEFORE_INSERT, [$this, 'beforeCreate']);
 }