/**
  * @inheritdoc
  */
 public function beforeDelete()
 {
     if ($this->depth == 0) {
         throw new \BadMethodCallException(\Yii::t('modules/post', "Root category can not be deleted."));
     }
     return parent::beforeDelete();
 }
Esempio n. 2
0
 /**
  * @inheritdoc
  */
 public function beforeDelete()
 {
     if (!$this->pid) {
         throw new Exception("Can not delete the root page");
     }
     return parent::beforeDelete();
 }