Return rows that has column equal to certain value

@param string $key   Column name
@param mixed  $value Value to compare

@return DataStore New dataStore containing results
967394
public function where($key,$value)
    {
        $dstore= new DataStore;
        $dstore->meta($this->metaData);
        foreach ($this->rows as $row) {
            if ($row[$key]==$value) {
                $dstore->append($row);
            }
        }
        return $dstore;
    }
456341
public function eq($column, $value = null)
    {
        return $this->where($column, $value, Cmp::EQ);
    }
380772
public function findByKeyAndValue(string $key, $value): MapInterface
    {
        return $this->find(function (MapInterface $item) use ($key, $value): bool {
            return $item->get($key) === $value;
        });
    }
1239306
public function get($key, $value = null)
    {
        return $this->headerBag->key($key, $value, true);
    }
82401
public function where($key, $value, $strict = true)
    {
        return $this->filter(function ($item) use ($key, $value, $strict) {
            return $strict ? ArrayHelper::getValue($item, $key) === $value
                : ArrayHelper::getValue($item, $key) == $value;
        });
    }
974531
public function set($key, $value = null)
    {
        if ($key === null) {
            array_push($this->storage, $value);

            return $this;
        }

        if (is_array($key)) {
            foreach ($key as $key => $value) {
                $this->storage[$key] = $value;
            }

            return $this;
        }

        $this->setValueToStack($this->storage, explode(self::SEPARATOR, $key), $value);

        return $this;
    }
1308564
public function search($key, $value)
	{
		foreach ($this->rows as $row)
		{
			if ($row->$key == $value)
			{
				return true;
			}
		}

		return false;
	}
1089407
public static function all(string $key = NULL, ?string $value = NULL): Collection {
        return static::attempt(function () use ($key, $value): Collection {
            $db = DB::instance();
            if ($key === NULL)
                $dat = $db -> selectall(static::table());
            else $dat = $db -> find(static::table(), implode(',', static::columns()), [$key => $value]);
            $objarr = new Collection();
            foreach ($dat as $local_data) {
                $ld = new static(['id' => $local_data['id']], $local_data);
                $objarr[] = $ld;
            }
            return $objarr;
        });
    }
778075
public function countByIndex( $key, $value ){
		$conditions	= array( $key => $value );
		return $this->table->count( $conditions );
	}
339738
public function contains($key, $value) {

		return in_array($value, $this->get($key, NULL, FALSE));

	}
310247
public function where($key, $condition = null, $value = null)
    {
        if (!is_null($condition) && is_null($value)) {
            $value = $condition;
            $condition = '=';
        }

        if (count($this->_conditions) < 1) {
            array_push($this->_conditions, []);
        }
        return $this->makeWhere($key, $condition, $value);
    }
1319475
protected function getValue( $key, $value = null )
	{
		if( is_null( $value ) && isset( $this->args[$key] )) {
			$value = $this->args[$key];
		}
		return $value;
	}
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;
    }
266303
protected function fetchByColumn($column, $value)
    {
        /**
         * @var \Slab\Database\Providers\BaseResponse $response
         */
        $response = $this->driver->query("select " . $this->getMappingAsSQL() . " from " . $this->getTable() . " where `" . $column . "` = ? limit 1;", array($value), static::DATA_OBJECT_CLASS);

        return $response->row();
    }
903849
public function whereMeta($key, $value)
    {
        return $this->getModelStub()
            ->whereKey(strtolower($key))
            ->whereValue($value)
            ->get();
    }
593995
public static function key($key, $value = null)
  {
    if ($value == null) return $_SESSION[$key];

    $_SESSION[$key] = $value;
  }
491069
protected function filterRelation($key, $value)
    {
        $key = str_replace('~', '.', $key);
        $parts = explode('.', $key);

        $realKey = array_pop($parts);
        $relation = implode('.', $parts);

        if (! in_array($relation, array_keys($this->with))) {
            return;
        }

        extract($this->formatParam($realKey, $value));

        if (! $this->canFilter($column)) {
            return;
        }

        $this->builder->whereHas($relation, function ($q) use ($column, $comparator, $value) {
            if ($comparator == 'IN') {
                $values = explode(',', $value);
                $q->whereIn($column, $values);
            } elseif ($comparator == 'NOT IN') {
                $values = explode(',', $value);
                $q->whereNotIn($column, $values);
            } else {
                $values = explode('|', $value);
                if (count($values) > 1) {
                    $q->where(function ($query) use ($column, $comparator, $values) {
                        foreach ($values as $value) {
                            if ($comparator == 'LIKE' || $comparator == 'NOT LIKE') {
                                $value = preg_replace('/(^\*|\*$)/', '%', $value);
                            }
                            // Link the filters with AND of there is a "not" and with OR if there's none
                            if ($comparator == '!=' || $comparator == 'NOT LIKE') {
                                $query->where($column, $comparator, $value);
                            } else {
                                $query->orWhere($column, $comparator, $value);
                            }
                        }
                    });
                } else {
                    $value = $values[0];
                    if ($comparator == 'LIKE' || $comparator == 'NOT LIKE') {
                        $value = preg_replace('/(^\*|\*$)/', '%', $value);
                    }
                    if ($comparator == 'NULL' || $comparator == 'NOT NULL') {
                        $q->whereNull($column, 'and', $comparator == 'NOT NULL');
                    } else {
                        $q->where($column, $comparator, $value);
                    }
                }
            }
        });
    }