• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/lib/orm/query/query.php
  • Класс: Bitrix\Main\ORM\Query\Query
  • Вызов: Query::__construct
public function __construct($source)
{
	if ($source instanceof $this)
	{
		$this->entity = Entity::getInstanceByQuery($source);
	}
	elseif ($source instanceof Entity)
	{
		$this->entity = clone $source;
	}
	elseif (is_string($source))
	{
		$this->entity = clone Entity::getInstance($source);
	}
	else
	{
		throw new Main\ArgumentException(sprintf(
			'Unknown source type "%s" for new %s', gettype($source), __CLASS__
		));
	}

	$this->filterHandler = static::filter();
	$this->whereHandler = static::filter();
	$this->havingHandler = static::filter();
}