- Модуль: landing
- Путь к файлу: ~/bitrix/modules/landing/lib/block.php
- Класс: BitrixLandingBlock
- Вызов: Block::isContains
static function isContains(int $entityId, string $needed, bool $isLanding = false): bool
{
$filter = [
'=ACTIVE' => 'Y',
'=DELETED' => 'N',
'CONTENT' => '%' . $needed . '%',
];
if ($isLanding)
{
$filter['LID'] = $entityId;
}
else
{
$filter['ID'] = $entityId;
}
$res = parent::getList([
'select' => [
'LID',
'SITE_ID' => 'LANDING.SITE_ID',
],
'filter' => $filter,
]);
if ($row = $res->fetch())
{
$res = Landing::getList([
'select' => [
'ID'
],
'filter' => [
'ID' => $row['LID']
]
]);
if ($res->fetch())
{
return true;
}
if (BitrixLandingSiteScopeGroup::getGroupIdBySiteId($row['SITE_ID'], true))
{
return true;
}
}
return false;
}