Exemple #1
0
 public function beforeSave($insert)
 {
     if ($this->type == Block::TYPE_PLAIN) {
         $this->content = strip_tags($this->content, '<br><br/><b><i><u><a><strong><em>');
     }
     return parent::beforeSave($insert);
 }
Exemple #2
0
 public function beforeDelete()
 {
     $items = MenuItem::findAll(['root_id' => $this->id, 'menu_id' => $this->menu_id]);
     foreach ($items as $item) {
         $item->delete();
     }
     return parent::beforeDelete();
 }