Download src/Ai/Application/CommandHandlers/ReadLibraryItemCommandHandler.php from pnacorp/AIKEEDO: direct link, hf CLI and curl.
- Browser
- Download file 636 Bytes
-
https://huggingface.co/pnacorp/AIKEEDO/resolve/main/src/Ai/Application/CommandHandlers/ReadLibraryItemCommandHandler.php
- Command line
-
hf download hf://pnacorp/AIKEEDO/src/Ai/Application/CommandHandlers/ReadLibraryItemCommandHandler.php
-
curl -L -o ReadLibraryItemCommandHandler.php https://huggingface.co/pnacorp/AIKEEDO/resolve/main/src/Ai/Application/CommandHandlers/ReadLibraryItemCommandHandler.php
636 Bytes
| declare(strict_types=1); | |
| namespace Ai\Application\CommandHandlers; | |
| use Ai\Application\Commands\ReadLibraryItemCommand; | |
| use Ai\Domain\Entities\AbstractLibraryItemEntity; | |
| use Ai\Domain\Exceptions\LibraryItemNotFoundException; | |
| use Ai\Domain\Repositories\LibraryItemRepositoryInterface; | |
| class ReadLibraryItemCommandHandler | |
| { | |
| public function __construct( | |
| private LibraryItemRepositoryInterface $repo, | |
| ) { | |
| } | |
| /** | |
| * @throws LibraryItemNotFoundException | |
| */ | |
| public function handle(ReadLibraryItemCommand $cmd): AbstractLibraryItemEntity | |
| { | |
| return $this->repo->ofId($cmd->item); | |
| } | |
| } | |