AIKEEDO / src /Preset /Application /CommandHandlers /ReadPresetCommandHandler.php
Softin Trading
Initial Commit from GitHub.
cf14c12
Raw History Blame Contribute Delete
593 Bytes
<?php
declare(strict_types=1);
namespace Preset\Application\CommandHandlers;
use Preset\Application\Commands\ReadPresetCommand;
use Preset\Domain\Entities\PresetEntity;
use Preset\Domain\Exceptions\PresetNotFoundException;
use Preset\Domain\Repositories\PresetRepositoryInterface;
class ReadPresetCommandHandler
{
public function __construct(
private PresetRepositoryInterface $repo
) {
}
/**
* @throws PresetNotFoundException
*/
public function handle(ReadPresetCommand $cmd): PresetEntity
{
return $this->repo->ofId($cmd->id);;
}
}