/**
  * Geocode requested address and use as center or fetch location that was
  * flagged as center. If
  *
  * @param Model\Constraint $constraint
  *
  * @throws \TYPO3\CMS\Extbase\Persistence\Generic\Exception
  * @return Model\Location
  */
 public function getCenter(Model\Constraint $constraint = null)
 {
     $center = null;
     if ($constraint !== null) {
         if ($constraint->getLatitude() && $constraint->getLongitude()) {
             /** @var Model\Location $center */
             $center = $this->objectManager->get('Evoweb\\StoreFinder\\Domain\\Model\\Location');
             $center->setLatitude($constraint->getLatitude());
             $center->setLongitude($constraint->getLongitude());
         } else {
             $center = $this->geocodeService->geocodeAddress($constraint);
         }
     }
     if ($center === null) {
         $center = $this->locationRepository->findOneByCenter();
     }
     if ($center === null) {
         $center = $this->locationRepository->findCenterByLatitudeAndLongitude();
     }
     return $center;
 }