diff --git a/trunk/app/Resources/views/default/pages/search.html.twig b/trunk/app/Resources/views/default/pages/search.html.twig index dc2a3242..9308b5bd 100644 --- a/trunk/app/Resources/views/default/pages/search.html.twig +++ b/trunk/app/Resources/views/default/pages/search.html.twig @@ -97,7 +97,10 @@ alt="Verfügbarkeit"> - buchen + + {# #TODO Bad performance #} + Details + {% endfor %} diff --git a/trunk/app/Resources/views/default/pages/travelProgram.html.twig b/trunk/app/Resources/views/default/pages/travelProgram.html.twig index f307f095..b4501299 100644 --- a/trunk/app/Resources/views/default/pages/travelProgram.html.twig +++ b/trunk/app/Resources/views/default/pages/travelProgram.html.twig @@ -180,7 +180,7 @@ - buchen + Buchungsformular diff --git a/trunk/src/AppBundle/Controller/DefaultController.php b/trunk/src/AppBundle/Controller/DefaultController.php index 56da1b91..d8ebd932 100644 --- a/trunk/src/AppBundle/Controller/DefaultController.php +++ b/trunk/src/AppBundle/Controller/DefaultController.php @@ -93,7 +93,7 @@ class DefaultController extends Controller $stopwatch = $this->get('debug.stopwatch'); $em = $this->getEntityManager(); - $destinationsIds = [6,7]; + $destinationIds = null; $destination = $em->getRepository('AppBundle:TravelCountry')->find($request->query->get('c')); if ($destination) { @@ -106,7 +106,7 @@ class DefaultController extends Controller $stopwatch->start('search'); $r = $this->getDoctrine()->getRepository('AppBundle:TravelPeriod')->getTravelProgramsWithTravelDatesForTimePeriod( - $startDate, $endDate, $destinationsIds, true); + $startDate, $endDate, $destinationIds, true); $stopwatch->stop('search'); return $this->render('default/pages/search.html.twig', [ diff --git a/trunk/src/AppBundle/Entity/Page.php b/trunk/src/AppBundle/Entity/Page.php index a84d0157..c23dae26 100644 --- a/trunk/src/AppBundle/Entity/Page.php +++ b/trunk/src/AppBundle/Entity/Page.php @@ -99,7 +99,7 @@ class Page /** * @var TravelProgram * - * @ORM\OneToOne(targetEntity="AppBundle\Entity\TravelProgram") + * @ORM\OneToOne(targetEntity="AppBundle\Entity\TravelProgram", inversedBy="page") * @ORM\JoinColumn(name="travel_program", referencedColumnName="id") */ private $travelProgram; diff --git a/trunk/src/AppBundle/Entity/TravelCountry.php b/trunk/src/AppBundle/Entity/TravelCountry.php index 3cf1ad73..714ae6ec 100644 --- a/trunk/src/AppBundle/Entity/TravelCountry.php +++ b/trunk/src/AppBundle/Entity/TravelCountry.php @@ -133,4 +133,45 @@ class TravelCountry { return $this->feedbackPage; } + /** + * Constructor + */ + public function __construct() + { + $this->programs = new \Doctrine\Common\Collections\ArrayCollection(); + } + + /** + * Add program + * + * @param \AppBundle\Entity\TravelProgram $program + * + * @return TravelCountry + */ + public function addProgram(\AppBundle\Entity\TravelProgram $program) + { + $this->programs[] = $program; + + return $this; + } + + /** + * Remove program + * + * @param \AppBundle\Entity\TravelProgram $program + */ + public function removeProgram(\AppBundle\Entity\TravelProgram $program) + { + $this->programs->removeElement($program); + } + + /** + * Get programs + * + * @return \Doctrine\Common\Collections\Collection + */ + public function getPrograms() + { + return $this->programs; + } } diff --git a/trunk/src/AppBundle/Entity/TravelProgram.php b/trunk/src/AppBundle/Entity/TravelProgram.php index 6bd735de..336fce5d 100644 --- a/trunk/src/AppBundle/Entity/TravelProgram.php +++ b/trunk/src/AppBundle/Entity/TravelProgram.php @@ -331,6 +331,11 @@ class TravelProgram */ private $options; + /** + * @ORM\OneToOne(targetEntity="AppBundle\Entity\Page", mappedBy="travelProgram") + */ + private $page; + /** * @var array|TravelDate[] */ @@ -1513,4 +1518,28 @@ class TravelProgram } return $this->getImages()[0]; } + + /** + * Set page + * + * @param \AppBundle\Entity\Page $page + * + * @return TravelProgram + */ + public function setPage(\AppBundle\Entity\Page $page = null) + { + $this->page = $page; + + return $this; + } + + /** + * Get page + * + * @return \AppBundle\Entity\Page + */ + public function getPage() + { + return $this->page; + } }