public function getFirstParentInLang($lang) { $x = $this; while ($x->id_parent != 0) { //$x != childs of root $x = $x->getParent(); $mutace = $x->lang($lang); if ($mutace and !$mutace['deleted']) { return $mutace; } } return PagesModel::getRoot($lang); }
public function startup() { parent::startup(); PagesModel::$lang = $this->lang; $this->pages = PagesModel::getRoot(); }