| @@ 294-308 (lines=15) @@ | ||
| 291 | * @param int $id |
|
| 292 | * @return array |
|
| 293 | */ |
|
| 294 | protected static function prepareIBlockElementArrayById($id) |
|
| 295 | { |
|
| 296 | $id = (int) $id; |
|
| 297 | if (!$id) { |
|
| 298 | return []; |
|
| 299 | } |
|
| 300 | ||
| 301 | if (empty(static::$iblockElementArray[$id])) { |
|
| 302 | $connection = Application::getConnection(); |
|
| 303 | $el = $connection->query("SELECT ID, IBLOCK_ID FROM b_iblock_element WHERE ID = {$id}")->fetch(); |
|
| 304 | static::$iblockElementArray[$id] = $el ? $el : []; |
|
| 305 | } |
|
| 306 | ||
| 307 | return static::$iblockElementArray[$id]; |
|
| 308 | } |
|
| 309 | ||
| 310 | /** |
|
| 311 | * @param int $id |
|
| @@ 314-328 (lines=15) @@ | ||
| 311 | * @param int $id |
|
| 312 | * @return array |
|
| 313 | */ |
|
| 314 | protected static function prepareIBlockSectionArrayById($id) |
|
| 315 | { |
|
| 316 | $id = (int) $id; |
|
| 317 | if (!$id) { |
|
| 318 | return []; |
|
| 319 | } |
|
| 320 | ||
| 321 | if (empty(static::$iblockSectionArray[$id])) { |
|
| 322 | $connection = Application::getConnection(); |
|
| 323 | $el = $connection->query("SELECT ID, IBLOCK_ID FROM b_iblock_section WHERE ID = {$id}")->fetch(); |
|
| 324 | static::$iblockSectionArray[$id] = $el ? $el : []; |
|
| 325 | } |
|
| 326 | ||
| 327 | return static::$iblockSectionArray[$id]; |
|
| 328 | } |
|
| 329 | } |
|
| 330 | ||