protected function get_value() {

		$query = $this->for_clause ? '(' : $this->get_comparison();

		if ( ! empty( $this->clauses ) ) {
			foreach ( $this->clauses as $i => $clause ) {

				// We don't want to add the connector if this is the first clause and there is no comparison.
				if ( strlen( $query ) > 1 ) {
					$query .= ' ' . $clause['type'] . ' ';
				}

				/** @var Where $where */
				$where = $clause['clause'];

				if ( ! $where->is_for_clause() ) {
					$query .= '(';
				}

				$query .= $where->get_value();

				if ( ! $where->is_for_clause() ) {
					$query .= ')';
				}
			}
		}

		if ( $this->for_clause ) {
			$query .= ')';
		}

		return $query;
	}
protected function get_value() {

		$query = $this->for_clause ? '(' : $this->get_comparison();

		if ( ! empty( $this->clauses ) ) {
			foreach ( $this->clauses as $i => $clause ) {

				// We don't want to add the connector if this is the first clause and there is no comparison.
				if ( strlen( $query ) > 1 ) {
					$query .= ' ' . $clause['type'] . ' ';
				}

				/** @var Where $where */
				$where = $clause['clause'];

				if ( ! $where->is_for_clause() ) {
					$query .= '(';
				}

				$query .= $where->get_value();

				if ( ! $where->is_for_clause() ) {
					$query .= ')';
				}
			}
		}

		if ( $this->for_clause ) {
			$query .= ')';
		}

		return $query;
	}
protected function get_value ( ) { $ query = $ this -> for_clause ? '(' : $ this -> get_comparison ( ) ; if ( ! empty ( $ this -> clauses ) ) { foreach ( $ this -> clauses as $ i => $ clause ) { // We don't want to add the connector if this is the first clause and there is no comparison. if ( strlen ( $ query ) > 1 ) { $ query .= ' ' . $ clause [ 'type' ] . ' ' ; } /** @var Where $where */ $ where = $ clause [ 'clause' ] ; if ( ! $ where -> is_for_clause ( ) ) { $ query .= '(' ; } $ query .= $ where -> get_value ( ) ; if ( ! $ where -> is_for_clause ( ) ) { $ query .= ')' ; } } } if ( $ this -> for_clause ) { $ query .= ')' ; } return $ query ; }
Override the value method. Handles recursion of nested Where clauses.

@since 1.0

@return string
Override the value method . Handles recursion of nested Where clauses .