Beispiel #1
0
 protected function afterInsert()
 {
     parent::afterInsert();
     $page = $this->getPage();
     if (!$page) {
         return;
     }
     $page['comments_counter'] = $page['comments_counter'] + 1;
     $page->save();
 }
Beispiel #2
0
 protected function afterInsert()
 {
     parent::afterInsert();
     if (!$this->isReal()) {
         return;
     }
     if (empty($this['url'])) {
         $this['url'] = '/page-' . $this['id'] . '.html';
         $this->save();
     }
     if (!empty($this['url'])) {
         // create new urlAlias if it is not set
         fx::data('urlAlias')->create(array('site_id' => $this['site_id'], 'page_id' => $this['id'], 'url' => $this['url'], 'is_original' => true))->save();
     }
 }