1 | <?php |
||
8 | class SectionModel extends BaseModel |
||
9 | { |
||
10 | /** |
||
11 | * Bitrix entity object. |
||
12 | * |
||
13 | * @var object |
||
14 | */ |
||
15 | public static $bxObject; |
||
16 | |||
17 | /** |
||
18 | * Corresponding object class name. |
||
19 | * |
||
20 | * @var string |
||
21 | */ |
||
22 | protected static $objectClass = 'CIBlockSection'; |
||
23 | |||
24 | /** |
||
25 | * List of params that can modify query. |
||
26 | * |
||
27 | * @var array |
||
28 | */ |
||
29 | protected static $additionalQueryModifiers = [ |
||
30 | 'countElements', |
||
31 | ]; |
||
32 | |||
33 | /** |
||
34 | * Corresponding iblock id. |
||
35 | * MUST be overridden. |
||
36 | * |
||
37 | * @throws Exception |
||
38 | * |
||
39 | * @return int |
||
40 | */ |
||
41 | public static function iblockId() |
||
45 | |||
46 | /** |
||
47 | * Instantiate a query object for the model. |
||
48 | * |
||
49 | * @return SectionQuery |
||
50 | */ |
||
51 | public static function query() |
||
55 | |||
56 | /** |
||
57 | * Get all model attributes from cache or database. |
||
58 | * |
||
59 | * @return array |
||
60 | */ |
||
61 | public function get() |
||
67 | |||
68 | /** |
||
69 | * Refresh model from database and place data to $this->fields. |
||
70 | * |
||
71 | * @return array |
||
72 | */ |
||
73 | public function refresh() |
||
79 | |||
80 | /** |
||
81 | * Refresh user fields and save them to a class field. |
||
82 | * |
||
83 | * @return array |
||
84 | */ |
||
85 | public function refreshFields() |
||
97 | |||
98 | /** |
||
99 | * Get IDs of direct children of the section. |
||
100 | * Additional filter can be specified. |
||
101 | * |
||
102 | * @param array $filter |
||
103 | * |
||
104 | * @return array |
||
105 | */ |
||
106 | public function getDirectChildren(array $filter = []) |
||
118 | |||
119 | /** |
||
120 | * Get IDs of all children of the section (direct or not). |
||
121 | * Additional filter can be specified. |
||
122 | * |
||
123 | * @param array $filter |
||
124 | * @param array|string $sort |
||
125 | * |
||
126 | * @return array |
||
127 | */ |
||
128 | public function getAllChildren(array $filter = [], $sort = ['LEFT_MARGIN' => 'ASC']) |
||
149 | } |
||
150 |