repo->ofId($cmd->id); if ($preset->isLocked()) { throw new LockedPresetException(); } // Delete the preset from the repository $this->repo->remove($preset); // Dispatch the preset deleted event $event = new PresetDeletedEvent($preset); $this->dispatcher->dispatch($event); } }