choosableSeasons; } public function setChoosableSeasons($choosableSeasons) { $this->choosableSeasons = $choosableSeasons; } public function getSeasons() { $prices = $this->getPrices(); $seasons = null; for($i = 0; $i < count($prices); $i++) { $seasons[] = $prices->get($i)->getSeason(); } return $seasons; } /** * Constructor */ public function __construct() { $this->prices = new \Doctrine\Common\Collections\ArrayCollection(); $this->images = new \Doctrine\Common\Collections\ArrayCollection(); $this->reservations = new \Doctrine\Common\Collections\ArrayCollection(); } /** * Get id * * @return integer */ public function getId() { return $this->id; } /** * Set name * * @param string $name * * @return FewoLodging */ public function setName($name) { $this->name = $name; return $this; } /** * Get name * * @return string */ public function getName() { return $this->name; } /** * Set description * * @param string $description * * @return FewoLodging */ public function setDescription($description) { $this->description = $description; return $this; } /** * Get description * * @return string */ public function getDescription() { return $this->description; } /** * Set equipment * * @param string $equipment * * @return FewoLodging */ public function setEquipment($equipment) { $this->equipment = $equipment; return $this; } /** * Get equipment * * @return string */ public function getEquipment() { return $this->equipment; } /** * Set adress1 * * @param string $adress1 * * @return FewoLodging */ public function setAdress1($adress1) { $this->adress1 = $adress1; return $this; } /** * Get adress1 * * @return string */ public function getAdress1() { return $this->adress1; } /** * Set adress2 * * @param string $adress2 * * @return FewoLodging */ public function setAdress2($adress2) { $this->adress2 = $adress2; return $this; } /** * Get adress2 * * @return string */ public function getAdress2() { return $this->adress2; } /** * Set zipCode * * @param string $zipCode * * @return FewoLodging */ public function setZipCode($zipCode) { $this->zipCode = $zipCode; return $this; } /** * Get zipCode * * @return string */ public function getZipCode() { return $this->zipCode; } /** * Set city * * @param string $city * * @return FewoLodging */ public function setCity($city) { $this->city = $city; return $this; } /** * Get city * * @return string */ public function getCity() { return $this->city; } /** * Set maximumPersons * * @param integer $maximumPersons * * @return FewoLodging */ public function setMaximumPersons($maximumPersons) { $this->maximumPersons = $maximumPersons; return $this; } /** * Get maximumPersons * * @return integer */ public function getMaximumPersons() { return $this->maximumPersons; } /** * Set deposit * * @param float $deposit * * @return FewoLodging */ public function setDeposit($deposit) { $this->deposit = $deposit; return $this; } /** * Get deposit * * @return float */ public function getDeposit() { return $this->deposit; } /** * Set calendarVisible * * @param boolean $calendarVisible * * @return FewoLodging */ public function setCalendarVisible($calendarVisible) { $this->calendarVisible = $calendarVisible; return $this; } /** * Get calendarVisible * * @return boolean */ public function getCalendarVisible() { return $this->calendarVisible; } /** * Set type * * @param \AppBundle\Entity\FewoLodgingGroup $group * * @return FewoLodging */ public function setGroup(\AppBundle\Entity\FewoLodgingGroup $group = null) { $this->group = $group; return $this; } /** * Get type * * @return \AppBundle\Entity\FewoLodgingGroup */ public function getGroup() { return $this->group; } /** * Set type * * @param \AppBundle\Entity\FewoLodgingType $type * * @return FewoLodging */ public function setType(\AppBundle\Entity\FewoLodgingType $type = null) { $this->type = $type; return $this; } /** * Get type * * @return \AppBundle\Entity\FewoLodgingType */ public function getType() { return $this->type; } /** * Add price * * @param \AppBundle\Entity\FewoPrice $price * * @return FewoLodging */ public function addPrice(\AppBundle\Entity\FewoPrice $price) { $this->prices[] = $price; return $this; } /** * Remove price * * @param \AppBundle\Entity\FewoPrice $price */ public function removePrice(\AppBundle\Entity\FewoPrice $price) { $this->prices->removeElement($price); } /** * Get prices * * @return \Doctrine\Common\Collections\Collection */ public function getPrices() { return $this->prices; } /** * Get prices * * @return \Doctrine\Common\Collections\Collection */ public function getPricesFilter($dateFrom, $dateTo) { return $this->getPrices()->filter(function(FewoPrice $price) use ($dateFrom, $dateTo) { if(!empty($price->getSeason())) return ($price->getSeason()->getFromDate() >= $dateFrom && $price->getSeason()->getFromDate() <= $dateTo) || ($price->getSeason()->getToDate() >= $dateFrom && $price->getSeason()->getToDate() <= $dateTo); }); } /** * Add image * * @param \AppBundle\Entity\FewoLodgingImage $image * * @return FewoLodging */ public function addImage(\AppBundle\Entity\FewoLodgingImage $image) { $this->images[] = $image; return $this; } /** * Remove image * * @param \AppBundle\Entity\FewoLodgingImage $image */ public function removeImage(\AppBundle\Entity\FewoLodgingImage $image) { $this->images->removeElement($image); } /** * Get images * * @return \Doctrine\Common\Collections\Collection */ public function getImages() { return $this->images; } /** * Add reservation * * @param \AppBundle\Entity\FewoReservation $reservation * * @return FewoLodging */ public function addReservation(\AppBundle\Entity\FewoReservation $reservation) { $this->reservations[] = $reservation; return $this; } /** * Remove reservation * * @param \AppBundle\Entity\FewoReservation $reservation */ public function removeReservation(\AppBundle\Entity\FewoReservation $reservation) { $this->reservations->removeElement($reservation); } /** * Get reservations * * @return \Doctrine\Common\Collections\Collection */ public function getReservations() { return $this->reservations; } /** * Get reservationsFilter * * @return \Doctrine\Common\Collections\Collection */ public function getReservationsFilter($dateFrom, $dateTo) { return $this->getReservations()->filter(function(FewoReservation $reservation) use ($dateFrom, $dateTo) { return ($reservation->getFromDate() >= $dateFrom && $reservation->getFromDate() <= $dateTo) || ($reservation->getToDate() >= $dateFrom && $reservation->getToDate() <= $dateTo); }); } /** * Set page * * @param \AppBundle\Entity\Page $page * * @return FewoLodging */ 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; } function __toString() { return $this->name; } }