Example #1
0
 /**
  * @return ShipmentOption
  */
 public function getById(ShipmentType $type, $id)
 {
     if ($type->isPersonal()) {
         return $this->personalPointRepository->find($id);
     } elseif ($type->isByTransportCompany()) {
         return $this->transportCompanyRepository->find($id);
     } elseif ($type->isToCollectionPoint()) {
         return $this->collectionPointRepository->find($id);
     } else {
         throw new \LogicException();
     }
 }