Пример #1
0
 /**
  * Get the children as sections or section IDs
  *
  * @param bool $as_sections
  *
  * @return Section[]|string[]
  */
 public function getChildren($as_sections = false)
 {
     if ($as_sections) {
         $sections = array();
         foreach ($this->_children as $section_id) {
             $section = SectionManager::getSection($section_id);
             if (!empty($section)) {
                 $sections[] = $section;
             }
         }
         return $sections;
     } else {
         return $this->_children;
     }
 }
Пример #2
0
 /**
  * @param $id
  *
  * @return bool
  */
 public static function sectionExists($id)
 {
     $section = SectionManager::getSection($id);
     return !empty($section);
 }