• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/lib/orm/fields/relations/reference.php
  • Класс: BitrixMainORMFieldsRelationsReference
  • Вызов: Reference::__construct
public function __construct($name, $referenceEntity, $referenceFilter, $parameters = array())
{
	parent::__construct($name);

	if ($referenceEntity instanceof Entity)
	{
		$this->refEntity = $referenceEntity;
		$this->refEntityName = $referenceEntity->getFullName();
	}
	else
	{
		// this one could be without leading backslash and/or with Table-postfix
		$this->refEntityName = Entity::normalizeName($referenceEntity);
	}

	if (empty($referenceFilter))
	{
		throw new ArgumentException('Reference for `'.$name.'` shouldn't be empty');
	}

	$this->reference = $referenceFilter;

	if (isset($parameters['join_type']))
	{
		$join_type = strtoupper($parameters['join_type']);

		if (in_array($join_type, Join::getTypes(), true))
		{
			$this->joinType = $join_type;
		}
	}
}