/**
  * @param CreateDojoCommand $command
  */
 public function handle(CreateDojoCommand $command)
 {
     $internalDojo = new Dojo($command->getZenId(), $command->getName(), $command->getCity(), $command->getLat(), $command->getLon(), $command->getEmail(), $command->getWebsite(), $command->getTwitter());
     $internalDojo->setZenCreatorEmail($command->getZenCreatorEmail());
     $internalDojo->setZenUrl($command->getZenUrl());
     $this->doctrine->persist($internalDojo);
     $event = new DojoCreatedEvent($command->getZenId(), $command->getZenCreatorEmail(), $command->getZenUrl(), $command->getName(), $command->getCity(), $command->getLat(), $command->getLon(), $command->getEmail(), $command->getWebsite(), $command->getTwitter(), $command->isRemoved());
     $this->eventRecorder->record($event);
 }
 /**
  * @param CreateEventCommand $command
  */
 public function handle(CreateEventCommand $command)
 {
     $dojo = $this->doctrine->getRepository('CoderDojoWebsiteBundle:Dojo')->find($command->getDojoId());
     $event = new DojoEvent();
     $event->setName($command->getName());
     $event->setDate($command->getDate());
     $event->setType($command->getType());
     $event->setZenId($command->getZenId());
     $event->setUrl($command->getUrl());
     $event->setDojo($dojo);
     $dojo->addEvent($event);
     $this->doctrine->persist($event);
     $this->doctrine->flush();
     $event = new EventCreatedEvent($command->getDojoId(), $command->getName(), $command->getDate(), $command->getUrl(), $command->getZenId(), $command->getType());
     $this->eventRecorder->record($event);
 }
Example #3
0
 /**
  * "Success" form handler
  *
  * @param OrderItem $entity
  */
 protected function onSuccess(OrderItem $entity)
 {
     $this->manager->persist($entity);
     $this->manager->flush();
 }