예제 #1
0
 /**
  * @Transform /^rest of the world$/
  * @Transform /^the rest of the world$/
  */
 public function getRestOfTheWorldZone()
 {
     $zone = $this->zoneRepository->findOneBy(['code' => 'RoW']);
     if (null === $zone) {
         throw new \Exception('Rest of the world zone does not exist.');
     }
     return $zone;
 }
예제 #2
0
 /**
  * @param array $parameters
  *
  * @return ZoneInterface
  */
 private function getZoneBy(array $parameters)
 {
     $existingZone = $this->zoneRepository->findOneBy($parameters);
     Assert::notNull($existingZone, 'Zone does not exist.');
     return $existingZone;
 }