• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/lib/orm/objectify/collection.php
  • Класс: BitrixMainORMObjectifyCollection
  • Вызов: Collection::__construct
public function __construct(Entity $entity = null)
{
	if (empty($entity))
	{
		if (__CLASS__ !== get_called_class())
		{
			// custom collection class
			$dataClass = static::$dataClass;
			$this->_entity = $dataClass::getEntity();
		}
		else
		{
			throw new ArgumentException('Entity required when constructing collection');
		}
	}
	else
	{
		$this->_entity = $entity;
	}

	$this->_objectClass = $this->_entity->getObjectClass();
	$this->_isSinglePrimary = count($this->_entity->getPrimaryArray()) == 1;
}