Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
categoryprovider.php
1<?php
3
6
13{
14
18 protected function availableFilterKeys()
19 {
20 return array('primary', 'parent_keys');
21 }
22
26 protected function availableRelations()
27 {
28 return array('parent', 'children');
29 }
30
34 protected function getManagerInstance()
35 {
37 }
38
42 protected function getEntitiesList()
43 {
44 return $this->getManagerInstance()->getCategoriesList();
45 }
46
50 protected function getIndices()
51 {
52 return $this->getManagerInstance()->getIndices();
53 }
54
58 protected function processWithParent(Category $entity)
59 {
60 $categoryProvider = new CategoryProvider();
61 $categoryProvider->addFilter('primary', $entity->getParentKey());
62 $categoryProvider->execute();
63
64 $entity->parent = $categoryProvider->getResults();
65 }
66
70 protected function processWithChildren(Category $entity)
71 {
72 $categoryProvider = new CategoryProvider();
73 $categoryProvider->addFilter('parent_keys', $entity->getKey());
74 $categoryProvider->addRelation('children');
75 $categoryProvider->execute();
76
77 $entity->children = $categoryProvider->getResults();
78 }
79
80
81}