Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- \Bitrix\Main\Loader::includeModule('iblock');
- \Bitrix\Main\Application::getConnection()->startTracker(true);
- $elements = \Bitrix\Iblock\ElementTable::getList([
- 'filter' => [
- 'ROOT.ID' => 947, // Раздел, в котором ищем включая подразделы.
- '==LINK.ADDITIONAL_PROPERTY_ID' => NULL, // Основная привязка элементов к группам.
- 'ACTIVE' => 'Y' // Активные элементы.
- ],
- 'sel ect' => [
- 'ID',
- ],
- 'group' => [
- 'ID'
- ],
- 'runtime' => [
- 'LINK' => [
- 'data_type' => \Bitrix\Iblock\SectionElementTable::class,
- 'reference' => [
- '=this.ID' => 'ref.IBLOCK_ELEMENT_ID',
- ],
- 'join_type' => 'inner',
- ],
- 'PARENT' => [
- 'data_type' => \Bitrix\Iblock\SectionTable::class,
- 'reference' => [
- '=this.LINK.IBLOCK_SECTION_ID' => 'ref.ID',
- ],
- 'join_type' => 'inner',
- ],
- 'ROOT' => [
- 'data_type' => \Bitrix\Iblock\SectionTable::class,
- 'reference' => [
- '=this.PARENT.IBLOCK_ID' => 'ref.IBLOCK_ID',
- '<=ref.LEFT_MARGIN' => 'this.PARENT.LEFT_MARGIN',
- '>=ref.RIGHT_MARGIN' => 'this.PARENT.RIGHT_MARGIN',
- ],
- 'join_type' => 'inner',
- ],
- ]
- ]);
- \Bitrix\Main\Application::getConnection()->stopTracker();
- var_dump($elements->fetch());
- print_r(\Bitrix\Main\Application::getConnection()->getTracker());
Add Comment
Please, Sign In to add comment