Exemplo n.º 1
0
 /**
  * @param RemoveCommand $command
  */
 public function handle(RemoveCommand $command)
 {
     $recipe = $command->getEntity();
     if (!$recipe instanceof Recipe) {
         throw new \RuntimeException(sprintf("Entity \"%s\" can't be handled by Recipe\\NewCommandHandler", get_class($recipe)));
     }
     $this->storage->remove($recipe);
     $this->engine->removeRecipeFromIndex($recipe);
 }
 /**
  * @param RemoveCommand $command
  */
 public function handle(RemoveCommand $command)
 {
     $this->removedObjects[] = $command->getEntity();
 }