1 | <?php |
||
44 | class SectionModel extends BitrixModel |
||
45 | { |
||
46 | /** |
||
47 | * Corresponding IBLOCK_ID |
||
48 | * |
||
49 | * @var int |
||
50 | */ |
||
51 | const IBLOCK_ID = null; |
||
52 | |||
53 | /** |
||
54 | * Bitrix entity object. |
||
55 | * |
||
56 | * @var object |
||
57 | */ |
||
58 | public static $bxObject; |
||
59 | |||
60 | /** |
||
61 | * Corresponding object class name. |
||
62 | * |
||
63 | * @var string |
||
64 | */ |
||
65 | protected static $objectClass = 'CIBlockSection'; |
||
66 | |||
67 | /** |
||
68 | * Update search after each create or update. |
||
69 | * |
||
70 | * @var bool |
||
71 | */ |
||
72 | protected static $updateSearch = true; |
||
73 | |||
74 | /** |
||
75 | * Getter for corresponding iblock id. |
||
76 | * |
||
77 | * @throws LogicException |
||
78 | * |
||
79 | * @return int |
||
80 | */ |
||
81 | public static function iblockId() |
||
90 | |||
91 | /** |
||
92 | * Instantiate a query object for the model. |
||
93 | * |
||
94 | * @return SectionQuery |
||
95 | */ |
||
96 | public static function query() |
||
100 | |||
101 | /** |
||
102 | * Create new item in database. |
||
103 | * |
||
104 | * @param $fields |
||
105 | * |
||
106 | * @throws ExceptionFromBitrix |
||
107 | * |
||
108 | * @return static|bool |
||
109 | */ |
||
110 | public static function create($fields) |
||
118 | |||
119 | /** |
||
120 | * Get IDs of direct children of the section. |
||
121 | * Additional filter can be specified. |
||
122 | * |
||
123 | * @param array $filter |
||
124 | * |
||
125 | * @return array |
||
126 | */ |
||
127 | public function getDirectChildren(array $filter = []) |
||
139 | |||
140 | /** |
||
141 | * Get IDs of all children of the section (direct or not). |
||
142 | * Additional filter can be specified. |
||
143 | * |
||
144 | * @param array $filter |
||
145 | * @param array|string $sort |
||
146 | * |
||
147 | * @return array |
||
148 | */ |
||
149 | public function getAllChildren(array $filter = [], $sort = ['LEFT_MARGIN' => 'ASC']) |
||
170 | |||
171 | /** |
||
172 | * Proxy for GetPanelButtons |
||
173 | * |
||
174 | * @param array $options |
||
175 | * @return array |
||
176 | */ |
||
177 | public function getPanelButtons($options = []) |
||
186 | |||
187 | public static function internalDirectCreate($bxObject, $fields) |
||
191 | |||
192 | /** |
||
193 | * @param $fields |
||
194 | * @param $fieldsSelectedForSave |
||
195 | * @return bool |
||
196 | */ |
||
197 | protected function internalUpdate($fields, $fieldsSelectedForSave) |
||
201 | |||
202 | /** |
||
203 | * @param $value |
||
204 | */ |
||
205 | public static function setUpdateSearch($value) |
||
209 | |||
210 | /** |
||
211 | * @param $query |
||
212 | * @param SectionModel $section |
||
213 | * @return SectionQuery |
||
214 | */ |
||
215 | public function scopeChildrenOf(SectionQuery $query, SectionModel $section) |
||
222 | |||
223 | /** |
||
224 | * @param $query |
||
225 | * @param SectionModel|int $section |
||
226 | * @return SectionQuery |
||
227 | */ |
||
228 | public function scopeDirectChildrenOf(SectionQuery $query, $section) |
||
234 | } |
||
235 |