Skip to content

Instantly share code, notes, and snippets.

@dima731515
Last active July 4, 2022 07:41
Show Gist options
  • Save dima731515/bffd1520b957cf5b130b66d059c4d04e to your computer and use it in GitHub Desktop.
Save dima731515/bffd1520b957cf5b130b66d059c4d04e to your computer and use it in GitHub Desktop.
Битрикс ORM getList, join (связная сущность) с дополнительными условиями.
$userId = 23;
...
new ReferenceField(
'IS_VISIT',
getHLEntityClassNameById(VIEWED_HL_BLOCK_ID),
[
'=this.ID' => 'ref.UF_ELEMENT_ID',
'=ref.UF_ENTITY_CODE' => new \Bitrix\Main\DB\SqlExpression('?i', 'case'),
'=ref.UF_USER_ID' => new \Bitrix\Main\DB\SqlExpression('?i', $userId)
],
['join_type' => 'LEFT']
)
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment