Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
categorymanager.php
1<?php
2
4
7
12class CategoryManager extends Base
13{
14 private static $categoriesList = array();
15 private static $indices = array(
16 'parent_keys' => array(),
17 );
18
22 protected function getEventTypeKey()
23 {
24 return Common::EVENT_CATEGORY_COLLECT;
25 }
26
30 public function call()
31 {
32 if (empty(self::$categoriesList))
33 {
35 $categories = $this->getResult();
36 foreach ($categories as $key => $category)
37 {
38 self::$categoriesList[$category->getKey()] = $category;
39 $parentKey = $category->getParentKey() ?: 'HEAD';
40 self::$indices['parent_keys'][$parentKey][] = $category->getKey();
41 }
42 }
43
44 return self::$categoriesList;
45 }
46
50 public function getCategoriesList()
51 {
52 return self::$categoriesList;
53 }
54
58 public function getIndices()
59 {
60 return self::$indices;
61 }
62
63
64
65
66}