Example #1
0
 public static function getRoot(BanersRubrics $model)
 {
     $root = $model->roots()->find();
     if (!$root) {
         $model->name = 'Каталог Baners Дерево';
         $model->url = 'RootTreeBaners';
         $model->parent_id = 0;
         $model->level = 1;
         $model->status = 1;
         $model->saveNode();
         $root = $model->roots()->find();
     }
     return $root;
 }