Simindey
2/6/2017 - 3:38 PM

SectionTable::getList

SectionTable::getList

<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/prolog_before.php");
\Bitrix\Main\Loader::includeModule("iblock");

	$result = \Bitrix\Iblock\SectionTable::getList(array(
		'select' => array('NAME'),
		'filter' => array('IBLOCK_ID'=>'2')
	));
	
	while ($row = $result->fetch())
	{
	$arResult[] = $row;
	}
	echo '<pre>';
	print_r($arResult);
	echo '</pre>';
	
	
	$dbElement = ElementTable::getList([
    'select' => ['ID', 'XML_ID', 'NAME', 'LINK', 'PROPERTY.ID', 'IBLOCK_ID'],
    'filter' => [
        '=IBLOCK_ID' => 3,
        '=LINK' => $elementID,
        '=PROPERTY.CODE' => 'CML2_LINK'
    ],
    'order' => ['ID'],
    'runtime' => [
        'PROPERTY' => [
            'data_type' => 'Bitrix\Iblock\PropertyTable',
            'reference' => ['=this.IBLOCK_ID' => 'ref.IBLOCK_ID'],
            'join_type' => "LEFT",
        ],
        'LINK' => [
            'data_type' => 'float',
            'expression' => [
                '(SELECT b_iblock_element_property.VALUE
                FROM b_iblock_element_property
                WHERE b_iblock_element_property.IBLOCK_PROPERTY_ID=%s
                    AND b_iblock_element_property.IBLOCK_ELEMENT_ID=%s)',
                'PROPERTY.ID',
                'ID',
            ],
        ],
    ],
]);