Пример #1
0
 public function save($runValidation = true, $attributes = null)
 {
     if ($this->id) {
         $oldThis = Page::model()->findByPk($this->id);
     } else {
         $oldThis = new Page();
     }
     $langs = array_keys(self::getLangs());
     foreach ($langs as $lang) {
         $param = $lang . '_url';
         $this->_url[$lang] = $oldThis->{$param};
         $newurl = $this->generateUrl(true, $lang . '_alias');
         if ($this->_url[$lang] != $newurl) {
             $this->{$param} = $newurl;
         }
     }
     return parent::save($runValidation, $attributes);
 }