• Модуль: perfmon
  • Путь к файлу: ~/bitrix/modules/perfmon/classes/general/sql_format.php
  • Класс: CSqlLevel
  • Вызов: CSqlLevel::changeLevelBefore
public function changeLevelBefore()
{
	if ($this->tokens[$this->current][1] === ")")
	{
		$this->level["("]--;
		$this->level["SELECT_".($this->balance + 1)] = 0;
		$this->level["JOIN_".($this->balance + 1)] = 0;
	}
	elseif (
		$this->tokens[$this->current][1] === "FROM"
		|| $this->tokens[$this->current][1] === "LIMIT"
	)
	{
		$this->level["SELECT_".$this->balance]--;
	}
	elseif (
		$this->tokens[$this->current][1] === "WHERE"
		|| $this->tokens[$this->current][1] === "GROUP"
		|| $this->tokens[$this->current][1] === "HAVING"
		|| $this->tokens[$this->current][1] === "ORDER"
	)
	{
		$this->level["SELECT_".$this->balance]--;
		if ($this->level["JOIN_".$this->balance] > 0)
			$this->level["JOIN_".$this->balance]--;
	}
	elseif (
		$this->tokens[$this->current][1] === "INNER"
		|| $this->tokens[$this->current][1] === "LEFT"
	)
	{
		if ($this->level["JOIN_".$this->balance] > 0)
			$this->level["JOIN_".$this->balance]--;
	}
}