parent
3a68ee4bcf
commit
73400e90fd
1 changed files with 7 additions and 5 deletions
|
@ -191,10 +191,12 @@ class RepeatingEventController extends Controller
|
||||||
$location = $request->get('location');
|
$location = $request->get('location');
|
||||||
$location_lat = $request->get('location_lat');
|
$location_lat = $request->get('location_lat');
|
||||||
$location_lon = $request->get('location_lon');
|
$location_lon = $request->get('location_lon');
|
||||||
|
|
||||||
|
/** @var EntityManager $em */
|
||||||
|
$em = $this->getDoctrine()->getManager();
|
||||||
|
|
||||||
if (strlen($location) > 0) {
|
if (strlen($location) > 0) {
|
||||||
// check if the location already exists
|
// check if the location already exists
|
||||||
/** @var EntityManager $em */
|
|
||||||
$em = $this->getDoctrine()->getManager();
|
|
||||||
$repo = $em->getRepository('CalciferBundle:Location');
|
$repo = $em->getRepository('CalciferBundle:Location');
|
||||||
$results = $repo->findBy(['name' => $location]);
|
$results = $repo->findBy(['name' => $location]);
|
||||||
if (count($results) > 0) {
|
if (count($results) > 0) {
|
||||||
|
@ -217,7 +219,7 @@ class RepeatingEventController extends Controller
|
||||||
if (strlen($location_lon) > 0) {
|
if (strlen($location_lon) > 0) {
|
||||||
$location_obj->lon = $location_lon;
|
$location_obj->lon = $location_lon;
|
||||||
}
|
}
|
||||||
$location_obj->slug = \URLify::filter($location_obj->name, 255, 'de');
|
$location_obj->slug = $location_obj->generateSlug($location_obj->name,$em);
|
||||||
$em->persist($location_obj);
|
$em->persist($location_obj);
|
||||||
$em->flush();
|
$em->flush();
|
||||||
$entity->location = $location_obj;
|
$entity->location = $location_obj;
|
||||||
|
@ -240,7 +242,7 @@ class RepeatingEventController extends Controller
|
||||||
} else {
|
} else {
|
||||||
$tag_obj = new Tag();
|
$tag_obj = new Tag();
|
||||||
$tag_obj->name = $tag;
|
$tag_obj->name = $tag;
|
||||||
$tag_obj->slug = \URLify::filter($tag_obj->name, 255, 'de');
|
$tag_obj->slug = $tag_obj->generateSlug($tag_obj->name,$em);
|
||||||
$em->persist($tag_obj);
|
$em->persist($tag_obj);
|
||||||
$em->flush();
|
$em->flush();
|
||||||
$entity->addTag($tag_obj);
|
$entity->addTag($tag_obj);
|
||||||
|
@ -250,7 +252,7 @@ class RepeatingEventController extends Controller
|
||||||
$entity->clearTags();
|
$entity->clearTags();
|
||||||
}
|
}
|
||||||
|
|
||||||
$entity->slug = \URLify::filter($entity->summary,255,'de');
|
$entity->slug = $entity->generateSlug($entity->summary,$em);
|
||||||
|
|
||||||
$em = $this->getDoctrine()->getManager();
|
$em = $this->getDoctrine()->getManager();
|
||||||
$em->persist($entity);
|
$em->persist($entity);
|
||||||
|
|
Reference in a new issue