Assembles a WHERE clause
@param string $condition
@param string $value
@param string $type
@return \Phiber\oosql\oosql
422274
public function where($condition, $value = null, $type = null)
    {

        switch ($type) {
            case null:
                $clause = 'WHERE';
                break;
            case 'or':
                $clause = 'OR';
                break;
            case 'and':
                $clause = 'AND';
                break;
            default:
                $clause = 'WHERE';
        }

        $this->oosql_where .= " $clause $condition";

        if ($value instanceof oosql) {

            $this->oosql_where .= $value->getSql();
        } elseif (null !== $value) {

            $this->oosql_conValues[] = $value;
        }

        return $this;
    }
979168
public function join(string $table, string $condition, string $type=''): QueryBuilderInterface
	{
		// Prefix and quote table name
		$table = explode(' ', mb_trim($table));
		$table[0] = $this->driver->quoteTable($table[0]);
		$table = $this->driver->quoteIdent($table);
		$table = implode(' ', $table);

		// Parse out the join condition
		$parsedCondition = $this->parser->compileJoin($condition);
		$condition = $table . ' ON ' . $parsedCondition;

		$this->state->appendMap("\n" . strtoupper($type) . ' JOIN ', $condition, 'join');

		return $this;
	}
1191270
public function whereIn($where, $value)
    {
        if( !is_array($value) ) {
            $value = (array) $value;
        }
        if( count($value) <= 0 ) {
            $this->where[] = array(new Expression('FALSE'));
        } else {
            $this->where[] = array($where, $value, 'IN');
        }
        return $this;
    }
581487
protected function makeWhere($key, $condition = null, $value = null)
    {
        $current = end($this->_conditions);
        $index = key($this->_conditions);
        if (is_callable($key)) {
            $key($this);
            return $this;
        }

        array_push($current, [
            'key' => $key,
            'condition' => $condition,
            'value' => $value,
        ]);

        $this->_conditions[$index] = $current;

        return $this;
    }
1077445
public function orWhere($key = null, $condition = null, $value = null)
    {
        if (!is_null($condition) && is_null($value)) {
            $value = $condition;
            $condition = '=';
        }

        array_push($this->_conditions, []);

        return $this->makeWhere($key, $condition, $value);
    }
726543
private function buildWhere($condition, $operator, $value, $method)
    {
        $method = strtoupper($method);
        $QueryBuilder = $this->getQueryBuilder();

        if($operator && ! in_array($operator, array('=', '<', '>', '<>', '>=', '<=')))
        {
            throw new \Exception( 'El operador "'.$operator.'" en el metodo "where" no es valido.' );
        }

        if($operator !== null && $value !== null)
        {
            $field = str_replace('.', '', $condition);
            $condition = "{$condition}{$operator}:$field";

            $QueryBuilder->setParameter(":$field", $value);
        }

        if($method == 'WHERE')
        {
            // Verifica que si existe un where para agregar un "AND WHERE"
            if(count($QueryBuilder->getQueryPart('where')) > 0)
            {
                $QueryBuilder->andWhere($condition);
            }
            else
            {
                $QueryBuilder->where($condition);
            }
        }
        else if($method == 'AND_WHERE')
        {
            $QueryBuilder->andWhere($condition);
        }
        else if($method == 'OR_WHERE')
        {
            $QueryBuilder->orWhere($condition);
        }
    }
1289252
public function orWhere($condition, $value = null, $type = null) {
		$this->_criteria->orWhere($condition);
		
		return $this;
	}
417109
public function join($table, $condition = null, $type = 'LEFT')
    {
        settype($table, 'array');

        $data = array(
            'table'     => current($table),
            'condition' => $condition,
            'type'      => $type
        );

        if (is_string(key($table))) {
            $this->join[key($table)] = $data;
        } else {
            $this->join[] = $data;
        }

        return $this;
    }
1011526
public function where($conditions, $values=null) {
		if(!$conditions)
			return $this;
		if($values !== null)
			$this->where[] = [$conditions => $values];
		else
			$this->where[] = $conditions;

		return $this;
	}
806642
public function where($condition, $value = null, $append = false, $clause = "WHERE")
    {
        if (is_array($value)) {
            $condition = $this->formatWhereConditionWithMultipleTokens($condition, $value, $this->escapeValidator);
        } else {
            if ($value === null) {
                $condition = preg_replace("/=\s*\?/", "IS ?", $condition, 1);
                $value = 'NULL';
            } else if (is_bool($value)) {
                $value = $value ? 'TRUE' : 'FALSE';
            } else if (is_int($value) || is_float($value)) {
                // Preserve $value as is
            } else {
                $rid = $this->ridValidator->check($value, true);
                $value = $rid ? $rid : '"' . $this->escapeValidator->check($value, true) . '"';
            }

            $condition = str_replace("?", $value, $condition);
        }

        if (!$this->getTokenValue('Where')) {
            $clause = 'WHERE';
        }

        $this->setTokenValues('Where', array("{$clause} $condition"), $append, false, false);

        return $this;
    }
731804
public function orWith($condition, ...$values): self
    {
        if ($condition instanceof EasyStatement) {
            $condition = '(' . $condition . ')';
        }
        if (!\is_string($condition)) {
            throw new \TypeError('An EasyStatement or string is expected for argument 1');
        }
        return $this->orWithString($condition, ...$values);
    }
550953
public function isFiltered($condition, $value, $type)
    {
        $isFiltered = true;
        switch ($condition[1]) {
        case '=':
        case '==':
        case 'equal':
            if ($type === 'string' && is_string($value) && is_string($condition[2])) {
                $isFiltered = strcmp($value, $condition[2]) == 0;
            } else {
                $isFiltered = $value == $condition[2];
            }

            break;
        case '!=':
        case 'notEqual':
            if ($type === 'string' && is_string($value) && is_string($condition[2])) {
                $isFiltered = strcmp($value, $condition[2]) != 0;
            } else {
                $isFiltered = $value != $condition[2];
            }

            break;
        case '>':
        case 'gt':
            if ($type === 'string') {
                $isFiltered = strcmp($value, $condition[2]) > 0;
            } else {
                $isFiltered = $value > $condition[2];
            }

            break;
        case '>=':
            if ($type === 'string') {
                $isFiltered = strcmp($value, $condition[2]) >= 0;
            } else {
                $isFiltered = $value >= $condition[2];
            }

            break;
        case '<':
        case 'lt':
            if ($type === 'string') {
                $isFiltered = strcmp($value, $condition[2]) < 0;
            } else {
                $isFiltered = $value < $condition[2];
            }

            break;
        case '<=':
            if ($type === 'string') {
                $isFiltered = strcmp($value, $condition[2]) <= 0;
            } else {
                $isFiltered = $value <= $condition[2];
            }

            break;
        case 'contain':
        case 'contains':
            $isFiltered = strpos(strtolower($value), strtolower($condition[2])) !== false;
            break;
        case 'notContain':
        case 'notContains':
            $isFiltered = strpos(strtolower($value), strtolower($condition[2])) === false;
            break;
        case 'startWith':
        case 'startsWith':
            $isFiltered = strpos(strtolower($value), strtolower($condition[2])) === 0;
            break;
        case 'notStartWith':
        case 'notStartsWith':
            $isFiltered = strpos(strtolower($value), strtolower($condition[2])) !== 0;
            break;
        case 'endWith':
        case 'endsWith':
            $isFiltered = strpos(strrev(strtolower($value)), strrev(strtolower($condition[2]))) === 0;
            break;
        case 'notEndWith':
        case 'notEndsWith':
            $isFiltered = strpos(strrev(strtolower($value)), strrev(strtolower($condition[2]))) !== 0;
            break;
        case 'between':
            $isFiltered = $value > $condition[2] && $value < $condition[3];
            break;
        case 'notBetween':
            $isFiltered = !($value > $condition[2] && $value < $condition[3]);
            break;
        case "in":
            if (!is_array($condition[2])) {
                $condition[2] = array($condition[2]);
            }

            $isFiltered = in_array($value, $condition[2]);
            break;
        case "notIn":
            if (!is_array($condition[2])) {
                $condition[2] = array($condition[2]);
            }

            $isFiltered = !in_array($value, $condition[2]);
            break;
        default:
            break;
        }
        return $isFiltered;
    }
413892
protected function checkValue($value, $condition) {
        list($filterType, $valueToCheck) = $condition;

        switch ($filterType) {
            case self::FILTER_TYPE_EQ:
                return $valueToCheck == $value;

            case self::FILTER_TYPE_NEQ:
                return $valueToCheck != $value;

            case self::FILTER_TYPE_LIKE:
                return strpos($value, $valueToCheck) !== false;

            default :
                throw new InvalidFilterTypeException("Filter type '$filterType' is unknown'");
        }
    }
589021
public function bindValue(string $param, $value, int $type = null)
    {
        if (is_null($type)) {
            switch (true) {
                case is_int($value):
                    $type = \PDO::PARAM_INT;
                    break;
                case is_bool($value):
                    $type = \PDO::PARAM_BOOL;
                    break;
                case is_null($value):
                    $type = \PDO::PARAM_NULL;
                    break;
                default:
                    $type = \PDO::PARAM_STR;
            }
        }
        
        if (is_array($value)) {
            $value = implode(', ', $value);
        }
        
        $this->stmt->bindValue($param, $value, $type);
    }
485200
public function where($where = null, $value = null)
        {
            if (Arrays::is($this->where)) {
                $this->whereKey = count($this->where) + 1;
            }

            $this->where[$this->whereKey]['attr'] = $where;
            $this->where[$this->whereKey]['value'] = $value;

            return $this;
        }
1305647
public function where( $condition ) {
		if ( ! $condition instanceof ConditionInterface ) {
			$condition = func_get_args();
		}

		$condition = $this->router->mergeConditionAttribute(
			$this->getAttribute( 'condition' ),
			$condition
		);

		return $this->attribute( 'condition', $condition );
	}
915632
public function bindValue($param, $value, $type=null)
    {
        $ok = false;
        try {
            $param = $this->_getBindVar($param);
            if (PDO::PARAM_LOB == $type) {
                $lob = \oci_new_descriptor($this->_con, \OCI_D_LOB);
                $ok  = \oci_bind_by_name($this->_stmt, $param, $lob, -1, \OCI_B_BLOB);
                $this->_bindsLob[$param] = array(
                    'lob'   => $lob,
                    'value' => $value,
                );
            } else {
                $ok = \oci_bind_by_name($this->_stmt, $param, $value);
                $this->_binds[$param] = $value;
            }
        } catch (\Exception $e) {
            throw new \PDOException($e->getMessage());
        }
        return $ok;
    }