Get all resources by a where clause ordered by recentness
@param  string $column
@param  mixed $value
@param  array  $options
@return Collection
773981
public function getRecentWhere($column, $value, array $options = [])
    {
        $query = $this->createBaseBuilder($options);

        $query->where($column, $value);

        $query->orderBy($this->getCreatedAtColumn(), 'DESC');

        return $query->get();
    }
660754
public function where($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 where clause.
        if (is_array($column)) {
            return $this->whereNested(function ($query) use ($column) {
                foreach ($column as $key => $value) {
                    $query->where($key, $value);
                }
            });
        }

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

        return $this;
    }
546050
public function fetchRow($column, $value)
    {
        $where = array($column, $value);

        return $this->tableGateway->select($where)->current();
    }
1328443
public function getByWhere($where, $value)
    {
        $db = new DB();
        $result = $db->db()->select(['db_name'=>__config()->auth->db_name, 'table'=>__config()->auth->db_table, 'wheres'=>["{$where} ="."'{$value}'"]]);
        $db->db()->close();

        return $result;
    }
1337550
public function orWhere($column, $operator, $value = null)
    {
        $this->orWheres[] = new Where($column, $operator, $value, 'OR');

        return $this;
    }
542271
public function where($column, $operator, $value = null)
    {
        if (count($this->wheres) > 0) {
            $this->andWhere($column, $operator, $value);
        }

        $this->wheres[] = new Where($column, $operator, $value);

        return $this;
    }
411268
public function whereGreaterThan($column, $value, $filter = false)
    {
        return $this->where($column, '>', $value, $filter);
    }
995284
public function filterByRelation($column, $value = null)
    {
        $relations = explode('.', $column);
        $column    = $this->getColumn($column = array_pop($relations), $relations);

        $relations = array_map(function ($relation) {
            return camel_case($relation);
        }, $relations);

        $this->instance->whereHas(implode('.', $relations), function (Builder $builder) use ($column, $value) {
            $value = in_array($value, ['true', 'false']) ? ($value === 'false' ? false : true) : $value;

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

        return $this;
    }
902478
public function or_where($column, $op = null, $value = null)
	{
		if($column instanceof \Closure)
		{
			$this->or_where_open();
			$column($this);
			$this->or_where_close();
			return $this;
		}

		if (is_array($column))
		{
			foreach ($column as $key => $val)
			{
				if (is_array($val))
				{
					$this->or_where($val[0], $val[1], $val[2]);
				}
				else
				{
					$this->or_where($key, '=', $val);
				}
			}
		}
		else
		{
			if(func_num_args() === 2)
			{
				$value = $op;
				$op = '=';
			}
			$this->_where[] = array('OR' => array($column, $op, $value));
		}
		return $this;
	}
834001
public function and_where($column, $op = null, $value = null)
	{
		if($column instanceof \Closure)
		{
			$this->and_where_open();
			$column($this);
			$this->and_where_close();
			return $this;
		}

		if (is_array($column))
		{
			foreach ($column as $key => $val)
			{
				if (is_array($val))
				{
					$this->and_where($val[0], $val[1], $val[2]);
				}
				else
				{
					$this->and_where($key, '=', $val);
				}
			}
		}
		else
		{
			if(func_num_args() === 2)
			{
				$value = $op;
				$op = '=';
			}
			$this->_where[] = array('AND' => array($column, $op, $value));
		}

		return $this;
	}
345275
public function filter($value, array $options = [])
    {
        if ( ! is_string($value) || empty(trim($value)))
            return $value;

        $this->checkOptions($options);

        list($currentFormat, $targetFormat) = array_map('trim', $options);

        return DateTime::createFromFormat($currentFormat, $value)->format($targetFormat);
    }
30892
public function lt($column, $value = null)
    {
        return $this->where($column, $value, Cmp::LT);
    }
470241
public function findAllBy($attribute, $value, $columns = ['*'])
    {
        return $this->model->where($attribute, '=', $value)->get($columns);
    }
761040
public static function where($column, $relation, $value)
    {
        $self = self::instance();
        $key = $self->_keyName;
        $data = \Query::from($self->_table)->select($key)->where($column, $relation, $value)->get();
        $rows = [];

        if (!is_null($data)) {
            foreach ($data as $item) {
                $rows[] = self::instance($item->$key);
            }
        }

        return $rows;
    }
7270
protected function modelWhere($column, $value = null)
    {
        $this->model = $this->model->where($column, $value);
        return $this;
    }
254891
private function findOptionsByColumn($column)
    {
        // Run a basic linear search
        foreach ($this->options as $collection) {
            // Make sure $collection is array
            if (is_array($collection)) {
                foreach ($collection as $row) {
                    if (is_array($row) && $row[self::GRID_PARAM_COLUMN] == $column) {
                        return $row;
                    }
                }
            }
        }

        return false;
    }
514831
public function where($column, $operator, $value, $quoted = false)
    {
        $this->where[] = array(
            'column' => $column,
            'operator' => $operator,
            'value' => $value,
            'quoted' => $quoted
        );
        return $this;
    }