RelationManager::getCustomRelations

  1. Bitrix24 API (v. 23.675.0)
  2. crm
  3. RelationManager
  4. getCustomRelations
  • Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/Relation/RelationManager.php
  • Класс: Bitrix\Crm\Relation\RelationManager
  • Вызов: RelationManager::getCustomRelations
protected function getCustomRelations(): Collection
{
	if ($this->customRelations === null)
	{
		$collection = $this->mapTableClass::getList([
			'cache' => [
				'ttl' => 86400,
			],
		])->fetchCollection();
		foreach ($collection as $entityObject)
		{
			if (
				!\CCrmOwnerType::IsDefined($entityObject->getSrcTypeId())
				|| !\CCrmOwnerType::IsDefined($entityObject->getDstTypeId())
				)
			{
				$collection->remove($entityObject);
			}
		}

		$this->customRelations = $this->ormCollectionToRelationCollection($collection);
	}

	return $this->customRelations;
}

Добавить комментарий