Build an SQL condition expressing that "$column is $value",
or "$column is in $value" if $value is an array. Handles null
and literals like new Literal( "NOW()" ) correctly.

@param string $column
@param string|array $value
@param bool $not
@return string
420925
function is( $column, $value, $not = false ) {

        $bang = $not ? "!" : "";
        $or = $not ? " AND " : " OR ";
        $novalue = $not ? "1=1" : "0=1";
        $not = $not ? " NOT" : "";

        // always treat value as array
        if ( !is_array( $value ) ) {

            $value = array( $value );

        }

        // always quote column identifier
        $column = $this->quoteIdentifier( $column );

        if ( count( $value ) === 1 ) {

            // use single column comparison if count is 1

            $value = $value[ 0 ];

            if ( $value === null ) {

                return $column . " IS" . $not . " NULL";

            } else {

                return $column . " " . $bang . "= " . $this->quote( $value );
            }

        } else if ( count( $value ) > 1 ) {

            // if we have multiple values, use IN clause

            $values = array();
            $null = false;

            foreach ( $value as $v ) {

                if ( $v === null ) {

                    $null = true;

                } else {

                    $values[] = $this->quote( $v );

                }

            }

            $clauses = array();

            if ( !empty( $values ) ) {

                $clauses[] = $column . $not . " IN ( " . implode( ", ", $values ) . " )";

            }

            if ( $null ) {

                $clauses[] = $column . " IS" . $not . " NULL";

            }

            return implode( $or, $clauses );

        }

        return $novalue;

    }
518545
public function whereNotIn($column, $values, $filter = false)
    {
        return $this->whereInValues(__FUNCTION__, $column, $values, $filter);
    }
43120
public function whereIn($column, $values, $boolean = 'and', $not = false)
    {
        $type = $not ? 'NotIn' : 'In';

        // If the value is a query builder instance we will assume the developer wants to
        // look for any values that exists within this given query. So we will add the
        // query accordingly so that this query is properly executed when it is run.
        if ($values instanceof self ||
            $values instanceof EloquentBuilder ||
            $values instanceof Closure) {
            [$query, $bindings] = $this->createSub($values);

            $values = [new Expression($query)];

            $this->addBinding($bindings, 'where');
        }

        // Next, if the value is Arrayable we need to cast it to its raw array form so we
        // have the underlying array value instead of an Arrayable object which is not
        // able to be added as a binding, etc. We will then add to the wheres array.
        if ($values instanceof Arrayable) {
            $values = $values->toArray();
        }

        $this->wheres[] = compact('type', 'column', 'values', 'boolean');

        // Finally we'll add a binding for each values unless that value is an expression
        // in which case we will just skip over it since it will be the query as a raw
        // string and not as a parameterized place-holder to be replaced by the PDO.
        $this->addBinding($this->cleanBindings($values), 'where');

        return $this;
    }
237717
public function orHaving($column, $operator = null, $value = null)
    {
        [$value, $operator] = $this->prepareValueAndOperator(
            $value, $operator, func_num_args() === 2
        );

        return $this->having($column, $operator, $value, 'or');
    }
1311740
public function where($column, $operator = '=', $value = null, $boolean = 'and', array $columns = ['*'])
    {
        return $this->mediator->transform($this->mediator(func_get_args()));
    }
11008
protected function addNullCondition(bool $not): WhereStatement
    {
        $this->sql->addWhereNullCondition($this->column, $this->separator, $not);
        return $this->statement;
    }
745249
public function postField($column, $value = null)
    {
        // If the column is an array, we will assume it is an array of key-value pairs
        // and can add them each as a post field.
        if (is_array($column)) {
            return $this->postFieldNested(function ($query) use ($column) {
                foreach ($column as $key => $value) {
                    $query->postField($key, $value);
                }
            });
        }

        $this->body[] = compact('column', 'value');

        return $this;
    }
413566
private function prepareWhereInStatement($column, $params, $not_in = false)
    {
        $qm = array_fill(0, count($params), "?");
        $in = ($not_in) ? "NOT IN" : "IN";
        $this->where[] = $column . " " . $in . " (" . implode(", ", $qm) . ")";
    }
429077
public function filterBy($column, $value = null)
    {
        $value = in_array($value, ['true', 'false']) ? ($value === 'false' ? false : true) : $value;

        is_bool($value)
            ? $this->instance->where($column, $value)
            : $this->instance->where($column, $this->getLikeOperator(), "%$value%");

        return $this;
    }
453994
public function whereIn($column, $values, $boolean = 'and', $not = false)
    {
        $type = $not ? 'NotIn' : 'In';

        // If the value is a query builder instance we will assume the developer wants to
        // look for any values that exists within this given query. So we will add the
        // query accordingly so that this query is properly executed when it is run.
        if ($values instanceof static) {
            return $this->whereInExistingQuery(
                $column,
                $values,
                $boolean,
                $not
            );
        }

        // If the value of the where in clause is actually a Closure, we will assume that
        // the developer is using a full sub-select for this "in" statement, and will
        // execute those Closures, then we can re-construct the entire sub-selects.
        if ($values instanceof Closure) {
            return $this->whereInSub($column, $values, $boolean, $not);
        }

        // Next, if the value is Arrayable we need to cast it to its raw array form so we
        // have the underlying array value instead of an Arrayable object which is not
        // able to be added as a binding, etc. We will then add to the wheres array.
        if ($values instanceof Arrayable) {
            $values = $values->toArray();
        }

        $this->wheres[] = compact('type', 'column', 'values', 'boolean');

        // Finally we'll add a binding for each values unless that value is an expression
        // in which case we will just skip over it since it will be the query as a raw
        // string and not as a parameterized place-holder to be replaced by the PDO.
        foreach ($values as $value) {
            if (!$value instanceof Expression) {
                $this->addBinding($value, 'where');
            }
        }

        return $this;
    }
219500
public function set(string $column, $value): UpdateQuery
    {
        $this->values[$column] = $value;

        return $this;
    }
609293
public function whereNotNull($column) {
		// secure the column name
		list($column) = Convert::columnToPlaceholder($this->Quote ,$column);
		// save the condition
		$this->Conditions[] = "{$this->Operator} ( {$column} IS NOT NULL )";
		// return self to the next method
		return $this;
	}
292323
public function whereNotIn($column, array $values)
    {
        if ($values === []) {
            throw new \InvalidArgumentException('Values for NOT IN() is empty');
        }

        return $this->where('%n %r', $column, new QueryElement('NOT IN()', $this->quote($values)));
    }
915946
public static function searchByColumnValue(array $array, $column, $value, bool $strict = false)
    {
        foreach ($array as $row) {
            if (!$strict && $row[$column] == $value) {
                return $row;
            } elseif ($strict && $row[$column] === $value) {
                return $row;
            }
        }

        return null;
    }
41200
public function whereNotNull($column, $boolean = 'and')
    {
        if (is_null($this->where)) {
            $this->where = '(`'. $column . '` is not null)';
        } else {
            $this->where .= ' ' . $boolean .' (`' . $column .'` is not null)';
        }

        return $this;
    }
514767
public function havingBetween($column, array $values, $boolean = 'and', $not = false)
    {
        $type = 'between';

        $this->havings[] = compact('type', 'column', 'values', 'boolean', 'not');

        $this->addBinding($this->cleanBindings($values), 'having');

        return $this;
    }
882031
public function notBetween($column, $value1, $value2)
	{
		return $this->between($column, $value1, $value2, 'AND', true);
	}