1 <?php declare(strict_types=1);
29 foreach ($handlers as $handler) {
30 $this->handlers[$handler->getID()] = $handler;
31 if ($handler->isPrimary()) {
32 if ($this->primary !== null) {
33 throw new \LogicException(
"Only one primary StorageHandler can exist");
35 $this->primary = $handler;
38 if ($this->primary === null) {
39 throw new \LogicException(
"One primary StorageHandler must exist");
54 if (isset($this->handlers[$storage_id])) {
55 return $this->handlers[$storage_id];
58 throw new \LogicException(
"no other StorageHandler possible at the moment");
Class FileResourceHandler.
Interface StorageResource.
getHandlerForStorageId(string $storage_id)
getHandlerForResource(StorableResource $resource)
__construct(array $handlers)
StorageHandlerFactory constructor.
Class StorageHandlerFactory.