• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/lib/orm/query/query.php
  • Класс: Bitrix\Main\ORM\Query\Query
  • Вызов: Query::buildWhere
protected function buildWhere()
{
	$sql = array();

	// old array filter
	if (!empty($this->where))
	{
		$csw = new \CSQLWhere;

		$csw_fields = $this->getFilterCswFields($this->where);
		$csw->setFields($csw_fields);

		$sql[] = trim($csw->getQuery($this->where));
	}

	// new QueryFilter
	if ($this->whereHandler && $this->whereHandler->hasConditions())
	{
		// rewrite data doubling
		$this->rewriteDataDoubling($this->whereHandler, 'where');

		$sql[] = $this->whereHandler->getSql($this->where_chains);
	}

	return join(' AND ', array_filter($sql));
}