Get all models.

@param string $key
@param string $value

@return Collection
18996
public function all()
    {
        if (!request('preview')) {
            $this->published();
        }

        return $this->executeCallback(static::class, __FUNCTION__, func_get_args(), function () {
            return $this->prepareQuery($this->createModel())
                ->order()
                ->get();
        });
    }
873259
protected function _findOneBy(string $key, $value): ?Entity
    {
        $result = $this->_findBy($key, $value);

        $entity = $result->first();

        return $entity === false ? null : $entity;
    }
669879
public function set(string $key, $value): KeyValueCollectionInterface
    {
        $this->keyMap[strtolower($key)] = $key;
        if ($value instanceof KeyValueCollectionInterface) {
            $value = $value->all();
        }
        $this->collection[$key] = $value;

        return $this;
    }
906924
public function lists($value = null, $key = null, array $options = []) {
        $repo = $this->getRepository();
        $key = $key ?: $repo->getPrimaryKey();
        $value = $value ?: $repo->getDisplayField();

        $options['key'] = $key;
        $options['value'] = $value;

        return $this->fields([$key, $value], true)->find('list', $options);
    }
1333490
private function filter($key, $value)
    {
        if (isset($this->filters[ $key ])) {
            foreach ($this->filters[ $key ] as $filter) {
                $value = $filter($value);
            }
        }

        return $value;
    }
1176124
protected function parseIds($value)
    {
        if ($value instanceof Model) {
            return [$value->{$this->relatedKey}];
        }

        if ($value instanceof Collection) {
            return $value->pluck($this->relatedKey)->all();
        }

        if ($value instanceof BaseCollection) {
            return $value->toArray();
        }

        return (array) $value;
    }
71646
public function set($key, $value)
    {
        $registry = ArrayHelper::set($this->getItems(), $key, $value, $useDotSyntax = true);
        $this->setItems($registry);

        return $this->getItems();
    }
609075
public static function keys($value)
    {

        if (is_array($value)) {
            return array_keys($value);
        }

        if (!is_object($value)) {
            return [];
        }

        if (!$value instanceof Traversable) {
            return array_keys(get_object_vars($value));
        }

        return array_keys(iterator_to_array($value, true));

    }
1228201
public function search(string $key, string $value)
    {
        return $this->getRepository()->findBy(['key' => $key, 'value' => $value]);
    }
913226
public function where($key, $value, bool $strict = true): ArrayCollection
    {
        return $this->filter(function ($item) use ($key, $value, $strict) {
            if (!isset($item[$key])) {
                return false;
            }

            return $strict ? $item[$key] === $value : $item[$key] == $value;
        });
    }
973837
public function set($key, $value)
    {
        $keys = explode('.', $key);

        $data = $this->getAll();

        $resource = &$data;
        foreach ($keys as $key) {
            if (!isset($resource[$key]) || !is_array($resource[$key])) {
                $resource[$key] = [];
            }
            $resource = &$resource[$key];
        }
        $resource = $value;

        $this->setAll($data);

        return $this;
    }
380772
public function findByKeyAndValue(string $key, $value): MapInterface
    {
        return $this->find(function (MapInterface $item) use ($key, $value): bool {
            return $item->get($key) === $value;
        });
    }
164169
public function get($key, $value = null)
    {
        return $this->queryBag->key($key, $value, true);
    }
906235
public function reverseTransform($value)
    {
        if ($value instanceof Collection) {
            return $value;
        }

        $collection = new ArrayCollection();
        if(null !== $value) {
            $collection->add($value);
        }

        return $collection;
    }
276456
public function query($key, $value = null)
    {
        if ($value) {
            return $this->replicate(['query' => [$key => $value]]);
        }

        return $this->replicate(['query' => $key]);
    }
1001595
public function pluck(string $column, string $key = null): Collection
    {
        $models = $this->queryRelate->getQuery()->pluck($column, $key);

        $this->resetQueryRelate();

        return $models;
    }
175032
public function get($key, $value = null)
    {
        return $this->postBag->key($key, $value, true);
    }