• Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/entitymanagefacility.php
  • Класс: Bitrix\Crm\EntityManageFacility
  • Вызов: EntityManageFacility::canAddEntity
public function canAddEntity($entityTypeId)
{
	switch ($entityTypeId)
	{
		case \CCrmOwnerType::Lead:
			return $this->canAddLead();
		case \CCrmOwnerType::Contact:
			if ($this->isLeadEnabled || $this->direction === self::DIRECTION_OUTGOING)
			{
				return $this->canAddContact();
			}
			else
			{
				return $this->canAddLead();
			}
		case \CCrmOwnerType::Company:
			return $this->canAddCompany();
		case \CCrmOwnerType::Deal:
			return $this->canAddDeal();
		default:
			throw new ArgumentException("Unsupported Entity Type Id: {$entityTypeId}");
	}
}