Filter items by the given key value pair.

@param string $key
@param mixed $value
@param string $operator
@return static
16814
public function where($key, $value, $operator = '==')
    {
        return $this->filter(function ($item) use ($key, $operator, $value) {
            $item = (array)$item;
            $retrieved = isset($item[$key]) ? $item[$key] : null;
            switch ($operator) {
                default:
                case '=':
                case '==':  return $retrieved == $value;
                case '!=':
                case '<>':  return $retrieved != $value;
                case '<':   return $retrieved < $value;
                case '>':   return $retrieved > $value;
                case '<=':  return $retrieved <= $value;
                case '>=':  return $retrieved >= $value;
                case '===': return $retrieved === $value;
                case '!==': return $retrieved !== $value;
            }
        });
    }
654437
protected static function operatorForWhere($key, $operator, $value)
    {
        return function ($item) use ($key, $operator, $value) {
            $retrieved = static::get($item, $key);

            switch ($operator) {
                default:
                case '=':
                case '==':  return $retrieved == $value;
                case '!=':
                case '<>':  return $retrieved != $value;
                case '<':   return $retrieved < $value;
                case '>':   return $retrieved > $value;
                case '<=':  return $retrieved <= $value;
                case '>=':  return $retrieved >= $value;
                case '===': return $retrieved === $value;
                case '!==': return $retrieved !== $value;
            }
        };
    }
109343
public function value($field, $operator, $value)
    {
        return $this->middleware($field, $this->get($field), $operator, $value);
    }
585773
public static function doUnaryOperation($operator, &$value)
    {
        if (self::$unaryOperations === null) {
            self::$unaryOperations = [
                    self::BITWISE_NOT   => function (&$i) { return ~$i; },
                    self::NOT           => function (&$i) { return !$i; },
                    self::INCREMENT     => function (&$i) { return $i++; },
                    self::DECREMENT     => function (&$i) { return $i--; },
                    self::PRE_INCREMENT => function (&$i) { return ++$i; },
                    self::PRE_DECREMENT => function (&$i) { return --$i; },
                    self::NEGATION      => function (&$i) { return -$i; },
                    self::PLUS          => function (&$i) { return +$i; },
            ];
        }

        if (!isset(self::$unaryOperations[$operator])) {
            throw new PinqException('Unary operator \'%s\' is not supported', $operator);
        }

        $operation = self::$unaryOperations[$operator];

        return $operation($value);
    }
1333490
private function filter($key, $value)
    {
        if (isset($this->filters[ $key ])) {
            foreach ($this->filters[ $key ] as $filter) {
                $value = $filter($value);
            }
        }

        return $value;
    }
820620
public function where($key, $operator = null, $value = null)
    {
        // If two params are given then assume operator is =
        if (func_num_args() == 2) {
            $value = $operator;
            $operator = '=';
        }
        return $this->whereHandler($key, $operator, $value);
    }
859807
public function getTagsByAttribute( $key, $value = NULL, $operator = "=" )
	{
		return $this->getTags( "*", $key, $value, $operator );
	}
689839
public static function where($key, $operator, $value = null)
    {
        if (func_num_args() === 2) {
            $value = $operator;
            $operator = '=';
        }

        if (! isset(static::$countries['longlist'])) {
            static::$countries['longlist'] = json_decode(static::getFile(__DIR__.'/../resources/data/longlist.json'), true);
        }

        return static::filter(static::$countries['longlist'], static::operatorForWhere($key, $operator, $value));
    }
539406
public function where($column, $operator, $value, $filter = false)
    {
        return $this->constraint(__FUNCTION__, $column, $operator, $value, $filter);
    }
605907
public function addFilter($field, $value, $operator= '=')
    {
        $this->filter[] = [
          'field' => $field,
          'value' => $value,
          'operator' => $operator,
        ];
        
        return $this;
    }
861676
public function pluck($value, $key = null)
    {
        return new static(ArrayHelper::pluck($this->items, $value, $key));
    }
552257
public function contains($key, $operator = null, $value = null)
    {
        if (func_num_args() == 1) {
            if ($this->useAsCallable($key)) {
                $placeholder = new stdClass;

                return $this->first($key, $placeholder) !== $placeholder;
            }

            return in_array($key, $this->items);
        }

        if (func_num_args() == 2) {
            $value = $operator;

            $operator = '=';
        }

        return $this->contains($this->operatorForWhere($key, $operator, $value));
    }
1278793
public function where($key, $value, $strict = true)
    {
        return $this->filter(function ($item) use ($key, $value, $strict)
        {
            return ($strict ? (data_get($item, $key) === $value) : (data_get($item, $key) == $value));
        });
    }
1022254
public function pullAll($field, $value, $operator = null)
    {
        return $this->pull($field, $value, $operator, true);
    }
1200684
public function searchWhere(string $column, $operator, $value = null)
    {
        if (func_num_args() < 3) {
            $value = $operator;

            $operator = null;
        }

        return $this->search(function ($item) use ($column, $operator, $value) {
            if ($operator === '>') {
                return $item[$column] > $value;
            }

            if ($operator === '<') {
                return $item[$column] < $value;
            }

            if ($operator === '!=' or $operator === '<>') {
                return $item[$column] != $value;
            }

            if (strtolower($operator) === 'in') {
                return in_array($item[$column], (array) $value);
            }

            return $item[$column] == $value;
        });
    }
384182
public function where($field, $operator = null, $value = null)
    {
        $this->addWhere($field, $operator, $value);

        return $this;
    }
286630
public function addFilter($field, $value, $operator)
    {
        if ((is_numeric($field) || !empty($field)) && (!empty($value) || $value == '0')) {
            if (!is_null($operator)) {
                $this->filters[$field][$operator] = $value;
            } else {
                $this->filters[$field] = $value;
            }
        }

        return $this;
    }