src/QueryBuilder.php
protected function _like(string $field, $val, string $pos, string $like='LIKE', string $conj='AND'): self
	{
		$field = $this->driver->quoteIdent($field);

		// Add the like string into the order map
		$like = $field. " {$like} ?";

		if ($pos === 'before')
		{
			$val = "%{$val}";
		}
		elseif ($pos === 'after')
		{
			$val = "{$val}%";
		}
		else
		{
			$val = "%{$val}%";
		}

		$conj = empty($this->state->getQueryMap()) ? ' WHERE ' : " {$conj} ";
		$this->state->appendMap($conj, $like, 'like');

		// Add to the values array
		$this->state->appendWhereValues($val);

		return $this;
	}
protected function _like(string $field, $val, string $pos, string $like='LIKE', string $conj='AND'): self
	{
		$field = $this->driver->quoteIdent($field);

		// Add the like string into the order map
		$like = $field. " {$like} ?";

		if ($pos === 'before')
		{
			$val = "%{$val}";
		}
		elseif ($pos === 'after')
		{
			$val = "{$val}%";
		}
		else
		{
			$val = "%{$val}%";
		}

		$conj = empty($this->state->getQueryMap()) ? ' WHERE ' : " {$conj} ";
		$this->state->appendMap($conj, $like, 'like');

		// Add to the values array
		$this->state->appendWhereValues($val);

		return $this;
	}
protected function _like ( string $ field , $ val , string $ pos , string $ like = 'LIKE' , string $ conj = 'AND' ) : self { $ field = $ this -> driver -> quoteIdent ( $ field ) ; // Add the like string into the order map $ like = $ field . " {$like} ?" ; if ( $ pos === 'before' ) { $ val = "%{$val}" ; } elseif ( $ pos === 'after' ) { $ val = "{$val}%" ; } else { $ val = "%{$val}%" ; } $ conj = empty ( $ this -> state -> getQueryMap ( ) ) ? ' WHERE ' : " {$conj} " ; $ this -> state -> appendMap ( $ conj , $ like , 'like' ) ; // Add to the values array $ this -> state -> appendWhereValues ( $ val ) ; return $ this ; }
Simplify 'like' methods

@param string $field
@param mixed $val
@param string $pos
@param string $like
@param string $conj
@return self
Simplify like methods