Find where a given column is equal to a given value and return the first occurence as the first element in the array.
@param string $column
@param array $operatorValue
@param string $joinOperator
@param int $limit
@return mixed
420885
public static function findByColumn (string $column, array $operatorValue, string $joinOperator="AND", int $limit=1)
	{
		$joinOperator 	= static::validateOperator($joinOperator, "AND");
		$expression 	= static::generateValue($column, $operatorValue, $joinOperator);
		$sqlQuery  		= "SELECT * FROM ".static::$tableName." WHERE {$column} {$expression}";
		return static::limitFindBySql($sqlQuery, $limit);
	}
439460
public static function findColumn (string $column, int $limit=0, string $order="DESC")
	{
		$order 		= static::validateOrder($order);
        $dbObject 	= Database::getInstance();
        $column 	= $dbObject->escapeValue($column);
		return static::limitFindBySql("SELECT {$column} FROM ".static::$tableName." ORDER BY id {$order}", $limit);
	}
517846
public function orWhere($column, $value, $operator = self::OPERATOR_EQ): self
    {
        $this->criteria($this->where, $column, $value, $operator, self::LOGICAL_OR);

        return $this;
    }
1174915
public function join($table, $column = null, $operator = null, $value = null) {
        $this->q->apd(' INNER JOIN ' . $table);

        if (!empty($column) || !empty($operator) || !empty($value)) {
            if (in_array($operator, $this->operators)) {
                $this->q->apd(' ON ' . $column . $operator . ' ' .  $value);
            } else {
                $value = '=';
                $this->q->apd(' ON ' . $column . ' ' . $value . ' ' . $operator);
            }

            return $this;
        } else {
            return $this;
        }
    }
1157676
public function get_column_values($table, $field,  array $where = [], $limit = false, $start = 0, $php = false)
  {
		if ( bbn\str::check_name($field) && ( $table = $this->table_full_name($table, 1) )  && ( $m = $this->db->modelize($table) ) && \count($m['fields']) > 0 )
		{
			$r = '';
			if ( $php ){
				$r .= '$db->query("';
			}
      if ( !isset($m['fields'][$field]) ){
        die("The column $field doesn't exist in $table");
      }
			$r .= "SELECT DISTINCT `$field` FROM $table".PHP_EOL.
        $this->db->get_where($where, $table).PHP_EOL.
        "ORDER BY `$field`";
      if ( $limit ){
  			$r .= PHP_EOL . $this->get_limit([$limit, $start]);
      }
			if ( $php ){
				$r .= '");';
			}
			return $r;
		}
		return false;
  }
539406
public function where($column, $operator, $value, $filter = false)
    {
        return $this->constraint(__FUNCTION__, $column, $operator, $value, $filter);
    }
185501
public function compare($column, $operator, $value, $filter = false)
    {
        if (!$this->isFilterable($filter, $value)) {
            return $this;
        }

        if ($value instanceof RawSqlFragmentInterface) {
            $value = $value->getFragment();
        }

        if ($value instanceof RawBindingInterface) {
            $value = $value->getTarget();
        }

        $this->append(sprintf(' %s %s %s ', $this->quote($column), $operator, $value));
        return $this;
    }
817710
public function on($column1, $column2 = null, $operator = '=')
    {
        return $this->addJoinCondition($column1, $column2, $operator);
    }
664683
public function join($table, $key, $operator = null, $value = null, $type = 'inner')
    {
        if (!$key instanceof \Closure) {
            $key = function ($joinBuilder) use ($key, $operator, $value) {
                $joinBuilder->on($key, $operator, $value);
            };
        }

        // Build a new JoinBuilder class, keep it by reference so any changes made
        // in the closure should reflect here
        $joinBuilder = $this->container->build('\\Pixie\\QueryBuilder\\JoinBuilder', array($this->connection));
        $joinBuilder = &$joinBuilder;
        // Call the closure with our new joinBuilder object
        $key($joinBuilder);
        $table = $this->addTablePrefix($table, false);
        // Get the criteria only query from the joinBuilder object
        $this->statements['joins'][] = compact('type', 'table', 'joinBuilder');

        return $this;
    }
1113277
public function related($relation, $column, $operator = null, $value = null, $boolean = 'and')
    {
        if ($column instanceof \Closure) {
            return $this->addRelated($relation, $column);
        }

        // If there is no value it is a where = ? query and we set the appropriate params
        if ($value === null) {
            $value = $operator;
            $operator = '=';
        }

        return $this->addRelated($relation, function ($query) use ($column, $operator, $value, $boolean) {
            return $query->where($column, $operator, $value, $boolean);
        });
    }
703428
public function orRelation($column1, $operator, $column2 = null)
    {
        if (func_num_args() < 3) {
            $column2 = $operator;

            $operator = null;
        }

        $this->addRelation('OR', $column1, $operator, $column2);

        return $this;
    }
674873
public function where($column, $operator, $value, $filter = false)
    {
        return $this->createConstraint(' WHERE', $column, $operator, $value, $filter);
    }
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;
    }
69170
public function where($column, $operator = '=', $value = null, $boolean = 'and', array $columns = ['*'])
    {
        return $this->repository->makeQuery()->where($column, $operator, $value, $boolean, $columns)->get($columns);
    }
952615
public function where($column, $operator = null, $value = null, $boolean = 'and') {
        // 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. We will maintain the boolean we
        // received when the method was called and pass it into the nested where.
        if (is_array($column)) {
            return $this->whereNested(function ($query) use ($column) {
                        foreach ($column as $key => $value) {
                            $query->where($key, '=', $value);
                        }
                    }, $boolean);
        }

        // Here we will make some assumptions about the operator. If only 2 values are
        // passed to the method, we will assume that the operator is an equals sign
        // and keep going. Otherwise, we'll require the operator to be passed in.
        if (func_num_args() == 2) {
            list($value, $operator) = [$operator, '='];
        } elseif ($this->invalidOperatorAndValue($operator, $value)) {
            throw new InvalidArgumentException('Illegal operator and value combination.');
        }

        // If the columns is actually a Closure instance, we will assume the developer
        // wants to begin a nested where statement which is wrapped in parenthesis.
        // We'll add that Closure to the query then return back out immediately.
        if ($column instanceof Closure) {
            return $this->whereNested($column, $boolean);
        }

        // If the given operator is not found in the list of valid operators we will
        // assume that the developer is just short-cutting the '=' operators and
        // we will set the operators to '=' and set the values appropriately.
        if (!in_array(strtolower($operator), $this->operators, true)) {
            list($value, $operator) = [$operator, '='];
        }

        // If the value is a Closure, it means the developer is performing an entire
        // sub-select within the query and we will need to compile the sub-select
        // within the where clause to get the appropriate query record results.
        if ($value instanceof Closure) {
            return $this->whereSub($column, $operator, $value, $boolean);
        }

        // If the value is "null", we will just assume the developer wants to add a
        // where null clause to the query. So, we will allow a short-cut here to
        // that method for convenience so the developer doesn't have to check.
        if (is_null($value)) {
            return $this->whereNull($column, $boolean, $operator != '=');
        }

        // Now that we are working with just a simple query we can put the elements
        // in our array and add the query binding to our array of bindings that
        // will be bound to each SQL statements when it is finally executed.
        $type = 'Basic';

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

        if (!$value instanceof Expression) {
            $this->addBinding($value, 'where');
        }

        return $this;
    }
155059
public static function whereColumn($a, $operator, $b = null)
    {
        list($operator, $b) = static::prepareOperatorAndValue(
            $operator, $b, func_num_args() === 2
        );

        return new ColumnConstraint($a, $operator, $b);
    }
901971
public function orHaving(string $column, $value, string $operator = self::OPERATOR_EQ): self
    {
        $this->criteria($this->having, $column, $value, $operator, self::LOGICAL_OR);

        return $this;
    }