protected function getEventManager() { $em = new EventManager(); $em->addEventSubscriber(new \Knp\DoctrineBehaviors\ORM\Geocodable\GeocodableSubscriber(new ClassAnalyzer(), false, 'Knp\\DoctrineBehaviors\\Model\\Geocodable\\Geocodable', function ($entity) { if ($location = $entity->getLocation()) { return $location; } return Point::fromArray(['longitude' => 47.7, 'latitude' => 7.9]); })); return $em; }
protected function getEventManager() { $em = new EventManager(); $em->addEventSubscriber(new \Knp\DoctrineBehaviors\ORM\Geocodable\GeocodableListener(function ($entity) { if ($location = $entity->getLocation()) { return $location; } return Point::fromArray(['longitude' => 47.7, 'latitude' => 7.9]); })); return $em; }