• Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/Relation/RelationManager.php
  • Класс: Bitrix\Crm\Relation\RelationManager
  • Вызов: RelationManager::bindTypes
public function bindTypes(Relation $relation): Result
{
	if ($this->areTypesBound($relation->getIdentifier()))
	{
		return (new Result())->addError(
			new Error(
				'The types are bound already',
				static::ERROR_CODE_BIND_TYPES_TYPES_ALREADY_BOUND
			)
		);
	}

	$entityObject = $this->mapTableClass::createObject();

	$entityObject
		->setSrcTypeId($relation->getParentEntityTypeId())
		->setDstTypeId($relation->getChildEntityTypeId())
	;

	$this->dropRelationsCache($relation->getIdentifier());

	return $this->updateEntityObject($relation->getSettings(), $entityObject);
}