Download src/Workspace/Application/CommandHandlers/DeleteInvitationCommandHandler.php from pnacorp/AIKEEDO: direct link, hf CLI and curl.
- Browser
- Download file 817 Bytes
-
https://huggingface.co/pnacorp/AIKEEDO/resolve/main/src/Workspace/Application/CommandHandlers/DeleteInvitationCommandHandler.php
- Command line
-
hf download hf://pnacorp/AIKEEDO/src/Workspace/Application/CommandHandlers/DeleteInvitationCommandHandler.php
-
curl -L -o DeleteInvitationCommandHandler.php https://huggingface.co/pnacorp/AIKEEDO/resolve/main/src/Workspace/Application/CommandHandlers/DeleteInvitationCommandHandler.php
817 Bytes
| declare(strict_types=1); | |
| namespace Workspace\Application\CommandHandlers; | |
| use Workspace\Application\Commands\DeleteInvitationCommand; | |
| use Workspace\Domain\Entities\WorkspaceEntity; | |
| use Workspace\Domain\Exceptions\WorkspaceNotFoundException; | |
| use Workspace\Domain\Exceptions\InvitationNotFoundException; | |
| use Workspace\Domain\Repositories\WorkspaceRepositoryInterface; | |
| class DeleteInvitationCommandHandler | |
| { | |
| public function __construct( | |
| private WorkspaceRepositoryInterface $repo | |
| ) { | |
| } | |
| /** | |
| * @throws WorkspaceNotFoundException | |
| * @throws InvitationNotFoundException | |
| */ | |
| public function handle(DeleteInvitationCommand $cmd): WorkspaceEntity | |
| { | |
| $ws = $this->repo->ofId($cmd->workspaceId); | |
| $ws->removeInvitation($cmd->id); | |
| return $ws; | |
| } | |
| } | |