RelationManager::getRelationTabsForDynamicChildren

  1. Bitrix24 API (v. 23.675.0)
  2. crm
  3. RelationManager
  4. getRelationTabsForDynamicChildren
  • Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/Relation/RelationManager.php
  • Класс: Bitrix\Crm\Relation\RelationManager
  • Вызов: RelationManager::getRelationTabsForDynamicChildren
public function getRelationTabsForDynamicChildren(
	int $parentEntityTypeId,
	int $parentEntityId,
	bool $isNew = false
): array
{
	$tabCodes = $this->getRelationTabCodes($parentEntityTypeId);

	$result = [];
	foreach ($tabCodes as $tabCode => $entityTypeId)
	{
		$router = Container::getInstance()->getRouter();
		$serviceUrl = $router->getChildrenItemsListUrl(
			$entityTypeId,
			$parentEntityTypeId,
			$parentEntityId
		);
		$factory = Container::getInstance()->getFactory($entityTypeId);
		if ($factory && $serviceUrl)
		{
			$result[] = [
				'id' => $tabCode,
				'name' => $factory->getEntityDescriptionInPlural(),
				'loader' => [
					'serviceUrl' => $serviceUrl,
					'componentData' => [
						'template' => '',
						'signedParameters' => $router->signChildrenItemsComponentParams(
							$entityTypeId,
							[
								'GRID_ID_SUFFIX' => 'PARENT_' . \CCrmOwnerType::ResolveName($parentEntityTypeId) . '_DETAILS',
								'TAB_ID' => $tabCode,
								'ENABLE_TOOLBAR' => true,
								'PRESERVE_HISTORY' => true,
								'PARENT_ENTITY_TYPE_ID' => $parentEntityTypeId,
								'PARENT_ENTITY_ID' => $parentEntityId,
							]
						)
					]
				],
				'enabled' => !$isNew,
			];
		}
	}

	return $result;
}

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