Retrieve all Objects stored in this storage.

@param callable $callback Function called after each iteration
@return \Generator<Object>
960681
public function getObjects(callable $callback = null)
    {
        foreach ($this->resourceManager->getCollectionsByStorage($this) as $collection) {
            yield $this->getObjectsByCollection($collection, $callback);
        }
    }
1336106
protected function buildQueueCallable($callback)
	{
		if ( !$callback instanceof Closure )
		{
			return $callback;
		}

		if ( class_exists('\SuperClosure\Serializer') )
		{
			return (new \SuperClosure\Serializer)->serialize($callback);
		}
		else
		{
			return serialize(new \Illuminate\Support\SerializableClosure($callback));
		}
	}
510997
public function filter(callable $callback): self
    {
        $set = clone $this;
        $set->internal_set = $this->internal_set->filter($callback);

        return $set;
    }
1110130
public function map(callable $callback = null)
	{
		return $callback ? array_map($callback, $this->list) : $this->list;
	}
171172
public function each($data = [], Closure $callback)
    {
        $factory = $this->getFactory();
        $results = array();
        foreach ($data as $item) {
            $callback($factory, $item);
            $results[] = $factory->getResults();
        }

        return $results;
    }
1233064
public function select($callback)
    {
        $hash = $this->create();

        foreach ($this as $key => $value) {
            if ($callback($value, $key) == true) {
                $hash[$key] = $value;
            }
        }

        return $hash;
    }
522886
public function previousAll(callable $callback = NULL) {
    $matches = [];
    foreach ($this->nodes as $node) {
      $matches = array_merge($matches, $node->previousAll($callback)->nodes);
    }
    return new NodeCollection($matches);
  }
723305
public function first(callable $callback = null, $default = null)
    {
        foreach ($this->generator as $item) {
            if (!$callback || $callback($item)) {
                return $item;
            }
        }

        return $default;
    }
727175
public function getObjectsByCollection(CollectionInterface $collection, callable $callback = null)
    {
        $iterator = $this->resourceRepository->findByCollectionNameIterator($collection->getName());
        $iteration = 0;
        foreach ($this->resourceRepository->iterate($iterator, $callback) as $resource) {
            /** @var PersistentResource $resource */
            $object = new StorageObject();
            $object->setFilename($resource->getFilename());
            $object->setSha1($resource->getSha1());
            $object->setMd5($resource->getMd5());
            $object->setFileSize($resource->getFileSize());
            $object->setStream(function () use ($resource) {
                return $this->getStreamByResource($resource);
            });
            yield $object;
            if (is_callable($callback)) {
                call_user_func($callback, $iteration, $object);
            }
            $iteration++;
        }
    }
155064
public function sort($callback)
    {
        $newCollection = clone $this;
        \uasort($newCollection->arrCollection, $callback);

        $newCollection->arrCollection = \array_values($newCollection->arrCollection);

        return $newCollection;
    }
178117
public function filter(callable $callback = null): CollectionInterface
    {
        if (!$callback) {
            $callback = function ($item) {
                return (bool)$item;
            };
        }

        return $this->wrap(function (Iterator $data) use ($callback) {
            foreach ($data as $key => $item) {
                if ($callback($item, $key)) {
                    yield $key => $item;
                }
            }
        });
    }
1130945
public function partition($callback): array
    {
        $partitions = [[], []];
        foreach ($this->generator as $key => $item) {
            if ($this->accessKey($item, $callback, $key)) {
                $partitions[0][$key] = $item;
            } else {
                $partitions[1][$key] = $item;
            }
        }

        return array_map(function ($value) {
            return $this::make($value);
        }, $partitions);
    }
978602
public function each(callable $callback)
    {
        foreach ($this->collection as $key => $value) {
            $callback($value, $key);
        }
    }
455648
public function each(callable $callback, $count = 1000)
    {
        $result = $this->getBuilder()->each($callback, $count);

        // Reset query builder
        $this->resetBuilder();

        return $result;
    }
977925
public function each(callable $callback)
    {
        if ($this->isCollection()) {
            foreach ($this->data as $val) {
                $callback($this->box($val));
            }
        } else {
            $callback($this->box($this->data));
        }

        return $this;
    }
1171018
public function indexes(Closure $callback)
    {
        $indexes = new Query\Indexes($this->collection);
        $callback($indexes);

        return $this;
    }
208153
public function transform(callable $callback): Collection
    {
        $this->items = $this->map($callback)->all();

        return $this;
    }