• Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/controller/timeline/item.php
  • Класс: Bitrix\Crm\Controller\Timeline\Item
  • Вызов: Item::checkPinnedLimit
private function checkPinnedLimit(int $id, int $ownerTypeId, int $ownerId): bool
{
	$existedItems = \Bitrix\Crm\Timeline\Entity\TimelineBindingTable::query()
		->where('ENTITY_TYPE_ID', $ownerTypeId)
		->where('ENTITY_ID', $ownerId)
		->where('IS_FIXED', true)
		->setSelect(['OWNER_ID'])
		->setLimit(self::MAX_PINNED_ITEMS_COUNT)
	;

	return (count($existedItems->exec()->fetchAll()) < self::MAX_PINNED_ITEMS_COUNT);

}