Beispiel #1
0
 protected function afterDelete()
 {
     parent::afterDelete();
     $page = $this->getPage();
     if (!$page) {
         return;
     }
     $page['comments_counter'] = $page['comments_counter'] > 0 ? $page['comments_counter'] - 1 : 0;
     $page->save();
 }
Beispiel #2
0
 protected function afterDelete()
 {
     parent::afterDelete();
     $killer = function ($cv) {
         $cv->delete();
     };
     // drop all urlAlias
     fx::data('urlAlias')->where('page_id', $this['id'])->all()->apply($killer);
     // @TODO: save for history
     if (!isset($this->_skip_cascade_delete_children) || !$this->_skip_cascade_delete_children) {
         $nested_ibs = $this->getNestedInfoblocks(true);
         foreach ($nested_ibs as $ib) {
             $ib->delete();
         }
     }
 }