ws instanceof WorkspaceEntity ? $cmd->ws : $this->repo->ofId($cmd->ws); $this->repo->remove($ws); // Dispatch the workspace created event $event = new WorkspaceDeletedEvent($ws); $this->dispatcher->dispatch($event); } }