/** * @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; }
/** * @param array $parameters * * @return ZoneInterface */ private function getZoneBy(array $parameters) { $existingZone = $this->zoneRepository->findOneBy($parameters); Assert::notNull($existingZone, 'Zone does not exist.'); return $existingZone; }