src/Neevo/Parser.php
protected function parseWhere(){
		$conds = $this->stmt->getConditions();

		// Unset glue on last condition
		unset($conds[count($conds)-1]['glue']);

		$conditions = array();
		foreach($conds as $cond){

			// Conditions with modifiers
			if($cond['simple'] === false){
				$values = $this->escapeValue($cond['values'], $cond['types']);
				$s = '(' . $this->applyModifiers($cond['expr'], $cond['modifiers'], $values) . ')';
				if(isset($cond['glue']))
					$s .= ' ' . $cond['glue'];

				$conditions[] = $s;
				continue;
			}

			// Simple conditions
			$field = $this->parseFieldName($cond['field']);
			$operator = '';
			$value = $cond['value'];
			if($value === null){ // field IS NULL
				$value = ' IS NULL';
			} elseif($value === true){	// field
				$value = '';
			} elseif($value === false){ // NOT field
				$value = $field;
				$field = 'NOT ';
			} elseif($value instanceof Result){
				$operator = ' IN ';
				$value = $this->escapeValue($value, Manager::SUBQUERY);
			} elseif(is_array($value) || $value instanceof Traversable){ // field IN (array)
				$value = ' IN ' . $this->escapeValue($value, Manager::ARR);
			} elseif($value instanceof Literal){ // field = SQL literal
				$operator = ' = ';
				$value = $this->escapeValue($value, Manager::LITERAL);
			} elseif($value instanceof DateTime){ // field = DateTime
				$operator = ' = ';
				$value = $this->escapeValue($value, Manager::DATETIME);
			} else{ // field = value
				$operator = ' = ';
				$value = $this->escapeValue($value);
			}
			$s = '(' . $field . $operator . $value . ')';
			if(isset($cond['glue']))
				$s .= ' '.$cond['glue'];

			$conditions[] = $s;

		}

		return "\nWHERE " . implode(' ', $conditions);
	}
protected function parseWhere(){
		$conds = $this->stmt->getConditions();

		// Unset glue on last condition
		unset($conds[count($conds)-1]['glue']);

		$conditions = array();
		foreach($conds as $cond){

			// Conditions with modifiers
			if($cond['simple'] === false){
				$values = $this->escapeValue($cond['values'], $cond['types']);
				$s = '(' . $this->applyModifiers($cond['expr'], $cond['modifiers'], $values) . ')';
				if(isset($cond['glue']))
					$s .= ' ' . $cond['glue'];

				$conditions[] = $s;
				continue;
			}

			// Simple conditions
			$field = $this->parseFieldName($cond['field']);
			$operator = '';
			$value = $cond['value'];
			if($value === null){ // field IS NULL
				$value = ' IS NULL';
			} elseif($value === true){	// field
				$value = '';
			} elseif($value === false){ // NOT field
				$value = $field;
				$field = 'NOT ';
			} elseif($value instanceof Result){
				$operator = ' IN ';
				$value = $this->escapeValue($value, Manager::SUBQUERY);
			} elseif(is_array($value) || $value instanceof Traversable){ // field IN (array)
				$value = ' IN ' . $this->escapeValue($value, Manager::ARR);
			} elseif($value instanceof Literal){ // field = SQL literal
				$operator = ' = ';
				$value = $this->escapeValue($value, Manager::LITERAL);
			} elseif($value instanceof DateTime){ // field = DateTime
				$operator = ' = ';
				$value = $this->escapeValue($value, Manager::DATETIME);
			} else{ // field = value
				$operator = ' = ';
				$value = $this->escapeValue($value);
			}
			$s = '(' . $field . $operator . $value . ')';
			if(isset($cond['glue']))
				$s .= ' '.$cond['glue'];

			$conditions[] = $s;

		}

		return "\nWHERE " . implode(' ', $conditions);
	}
protected function parseWhere ( ) { $ conds = $ this -> stmt -> getConditions ( ) ; // Unset glue on last condition unset ( $ conds [ count ( $ conds ) - 1 ] [ 'glue' ] ) ; $ conditions = array ( ) ; foreach ( $ conds as $ cond ) { // Conditions with modifiers if ( $ cond [ 'simple' ] === false ) { $ values = $ this -> escapeValue ( $ cond [ 'values' ] , $ cond [ 'types' ] ) ; $ s = '(' . $ this -> applyModifiers ( $ cond [ 'expr' ] , $ cond [ 'modifiers' ] , $ values ) . ')' ; if ( isset ( $ cond [ 'glue' ] ) ) $ s .= ' ' . $ cond [ 'glue' ] ; $ conditions [ ] = $ s ; continue ; } // Simple conditions $ field = $ this -> parseFieldName ( $ cond [ 'field' ] ) ; $ operator = '' ; $ value = $ cond [ 'value' ] ; if ( $ value === null ) { // field IS NULL $ value = ' IS NULL' ; } elseif ( $ value === true ) { // field $ value = '' ; } elseif ( $ value === false ) { // NOT field $ value = $ field ; $ field = 'NOT ' ; } elseif ( $ value instanceof Result ) { $ operator = ' IN ' ; $ value = $ this -> escapeValue ( $ value , Manager :: SUBQUERY ) ; } elseif ( is_array ( $ value ) || $ value instanceof Traversable ) { // field IN (array) $ value = ' IN ' . $ this -> escapeValue ( $ value , Manager :: ARR ) ; } elseif ( $ value instanceof Literal ) { // field = SQL literal $ operator = ' = ' ; $ value = $ this -> escapeValue ( $ value , Manager :: LITERAL ) ; } elseif ( $ value instanceof DateTime ) { // field = DateTime $ operator = ' = ' ; $ value = $ this -> escapeValue ( $ value , Manager :: DATETIME ) ; } else { // field = value $ operator = ' = ' ; $ value = $ this -> escapeValue ( $ value ) ; } $ s = '(' . $ field . $ operator . $ value . ')' ; if ( isset ( $ cond [ 'glue' ] ) ) $ s .= ' ' . $ cond [ 'glue' ] ; $ conditions [ ] = $ s ; } return "\nWHERE " . implode ( ' ' , $ conditions ) ; }
Parses WHERE clause.
@return string
Parses WHERE clause .