- Модуль: crm
- Путь к файлу: ~/bitrix/modules/crm/lib/Relation/RelationManager.php
- Класс: Bitrix\Crm\Relation\RelationManager
- Вызов: RelationManager::getAvailableForBindingEntityTypes
protected function getAvailableForBindingEntityTypes(): array
{
if ($this->availableEntityTypes === null)
{
$this->availableEntityTypes = [];
$entityTypeIds = [
\CCrmOwnerType::Lead => \CCrmOwnerType::Lead,
\CCrmOwnerType::Contact => \CCrmOwnerType::Contact,
\CCrmOwnerType::Company => \CCrmOwnerType::Company,
\CCrmOwnerType::Deal => \CCrmOwnerType::Deal,
\CCrmOwnerType::Order => \CCrmOwnerType::Order,
];
if (QuoteSettings::getCurrent()->isFactoryEnabled())
{
$entityTypeIds[\CCrmOwnerType::Quote] = \CCrmOwnerType::Quote;
}
if (InvoiceSettings::getCurrent()->isSmartInvoiceEnabled())
{
$entityTypeIds[\CCrmOwnerType::SmartInvoice] = \CCrmOwnerType::SmartInvoice;
}
foreach ($entityTypeIds as $entityTypeId)
{
$this->availableEntityTypes[$entityTypeId] = [
'entityTypeId' => $entityTypeId,
'title' => \CCrmOwnerType::GetDescription($entityTypeId),
];
}
$typesMap = Container::getInstance()->getDynamicTypesMap();
$typesMap->load([
'isLoadStages' => false,
'isLoadCategories' => false,
]);
foreach ($typesMap->getTypes() as $type)
{
$entityTypeId = $type->getEntityTypeId();
$this->availableEntityTypes[$entityTypeId] = [
'entityTypeId' => $entityTypeId,
'title' => $type->getTitle(),
];
}
}
return $this->availableEntityTypes;
}