public function getCollectionsByStorage(StorageInterface $storage) { $this->initialize(); $collections = []; foreach ($this->collections as $collectionName => $collection) { /** @var CollectionInterface $collection */ if ($collection->getStorage() === $storage) { $collections[$collectionName] = $collection; } } return $collections; }
/** * Retrieve all Objects stored in this storage. * * @param callable $callback Function called after each iteration * @return \Generator<Object> */ public function getObjects(callable $callback = null) { foreach ($this->resourceManager->getCollectionsByStorage($this) as $collection) { (yield $this->getObjectsByCollection($collection, $callback)); } }