/**
  * @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);
 }
Ejemplo n.º 2
0
 /**
  * Updates the internal dojo with data from the external dojo
  *
  * @param InternalDojo $internalDojo
  * @param CreateDojoCommand $externalDojo
  */
 private function updateInternalDojo(InternalDojo $internalDojo, CreateDojoCommand $externalDojo)
 {
     $this->progressBar->setMessage('Matched internal dojo: ' . $internalDojo->getName());
     $internalDojo->setZenId($externalDojo->getZenId());
     $internalDojo->setZenCreatorEmail($externalDojo->getZenCreatorEmail());
     $internalDojo->setZenUrl($externalDojo->getZenUrl());
     $internalDojo->setName($externalDojo->getName());
     $internalDojo->setLat($externalDojo->getLat());
     $internalDojo->setLon($externalDojo->getLon());
     $internalDojo->setEmail($externalDojo->getEmail());
     $internalDojo->setWebsite($externalDojo->getWebsite());
     $internalDojo->setTwitter($externalDojo->getTwitter());
     $this->countUpdated++;
     $this->progressBar->advance();
 }