Where Nested Select

Add a nested select as a value to the where predicate.

@param string $column Column name
@param \Closure $nested Nested builder
@param string $lOpr Logical operator, default string("IN")
@return self
773384
public function nestedWhere(
        string $column,
        \Closure $nested,
        string $lOpr = "IN"
    ): self {
        $this->qBuilder->nestedWhere($column, $nested, $lOpr, "AND");
        return $this;
    }
500531
public function whereIn($column, array $values)
    {
        if ($values === []) {
            throw new \InvalidArgumentException('Values for IN() is empty');
        }

        return $this->where('%n %r', $column, new QueryElement('IN()', $this->quote($values)));
    }
226808
public function andHaving($column, Closure $value = null): self
    {
        return $this->addCondition($column, $value, 'AND');
    }
550244
public static function getTreeWhere($column, $operator = null, $value = null, array $columns = ['*'])
    {
        /**
         * @var Entity $instance
         */
        $instance = new static;
        $columns = $instance->prepareTreeQueryColumns($columns);

        return $instance->where($column, $operator, $value)->get($columns)->toTree();
    }
972373
public function findWhere($where, $columns = ['*'], $or = false)
    {
        $model = $this->query();

        foreach ($where as $field => $value) {

            if ($value instanceof Closure) {

                $model = ( ! $or)
                    ? $model->where($value)
                    : $model->orWhere($value);

            } elseif (is_array($value)) {

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

                    list($field, $operator, $search) = $value;

                    $model = ( ! $or)
                        ? $model->where($field, $operator, $search)
                        : $model->orWhere($field, $operator, $search);

                } elseif (count($value) === 2) {

                    list($field, $search) = $value;

                    $model = ( ! $or)
                        ? $model->where($field, $search)
                        : $model->orWhere($field, $search);
                }

            } else {
                $model = ( ! $or)
                    ? $model->where($field, $value)
                    : $model->orWhere($field, $value);
            }
        }

        return $model->get($columns);
    }
153876
public function andHaving($column, Closure $value = null)
    {
        return $this->buildSelect()->andHaving($column, $value);
    }
518508
public function whereNull($column) {
		// secure the column name
		list(
			$column, 
			$placeholder
		) = Convert::columnToPlaceholder($this->Quote ,$column);
		// save the condition
		$this->Conditions[] = "{$this->Operator} ( {$column} IS NULL )";
		// add the empty value
		$this->Values[":empty_{$placeholder}"] = '';
		// return self to the next method
		return $this;
	}
221253
public function whereIn($column, $values, $table = null)
    {
        $this->db()->whereIn($column, $values, $table);
        return $this;
    }
1326628
public function select($column)
    {
        $builder         = new Select($this->driver);
        $this->lastQuery = $builder;

        $columns = is_array($column) ? $column : func_get_args();

        return $builder->select($columns);
    }
1207269
public function findWhere (string $column=NULL, ...$values)
    {
    	if (empty($this->filteredResult)) return $this;
		$newReadResult 			= filterObject($this->filteredResult, $column, ...$values);
		$this->filteredResult 	= $newReadResult;
		$this->result 			= $newReadResult;
		return $this;
    }
900384
public function select($columns)
  {
    $this->type = 'select';

    if ( is_null($this->select) ){
      $this->select = new Element('SELECT', $columns);
    }
    else {
      $this->select->append($columns);
    }

    return $this;
  }
142383
protected function addCondition($column, Closure $value = null, $separator = 'AND'): self
    {
        if (($column instanceof Closure) && $value === null) {
            $this->sql->addHavingGroupCondition($column, $separator);
        } else {
            $expr = $this->expression->init($column, $separator);
            if ($value) {
                $value($expr);
            }
        }
        return $this;
    }
269466
private function _select($column)
    {
        if ($column === 'all' || $column == '*') {
            $this->selectColumns = $this->quoteIdentifier(
                    self::cyrus()->getTableName()
                ).'.*';
        } else {
            if (string_has($column, 'as') || string_has($column, 'AS')) {
                return $this->selectExpr($column);
            }

            $this->selectColumns = (string) str_replace(' ', '', $this->quoteIdentifier(explode(',', $column)));
        }

        return $this;
    }
590218
final protected function where_in($column, array $values, $format = '%s', $or = false){
        $replace_values = [];
        foreach( $values as $val ){
            $replace_values[] = $this->db->prepare($format, $val);
        }
        $this->_wheres[] = [$this->and_or($or), sprintf('%s IN (%s)', $this->escape_column_name($column), implode(', ', $replace_values))];
        return $this;
    }
330737
public function orWhere($column, $expression = null, $value = null)
    {
        return $this->doWhere(self::OR_WHERE, $column, $expression, $value);
    }
1165754
public function or_having($column, $op = null, $value = null)
	{
		if($column instanceof \Closure)
		{
			$this->or_having_open();
			$column($this);
			$this->or_having_close();
			return $this;
		}

		if(func_num_args() === 2)
		{
			$value = $op;
			$op = '=';
		}

		$this->_having[] = array('OR' => array($column, $op, $value));

		return $this;
	}
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;
    }