Skip to content

Instantly share code, notes, and snippets.

@chebanenko
Created January 22, 2016 07:55
Show Gist options
  • Save chebanenko/666c612c34b321fdcc13 to your computer and use it in GitHub Desktop.
Save chebanenko/666c612c34b321fdcc13 to your computer and use it in GitHub Desktop.
Get Properties D7
$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',
],
],
],
]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment