From 1d3c8c75733796323c219a5e69cac3124aad36ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bjo=CC=88rn=20Fromme?= Date: Tue, 18 Sep 2018 12:56:56 +0200 Subject: [PATCH] Exclude hotels from maps as configured for teasers --- .../Classes/Controller/MapController.php | 3 +++ .../Classes/Domain/Model/Hotel.php | 21 +++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/web/typo3conf/ext/ep_products/Classes/Controller/MapController.php b/web/typo3conf/ext/ep_products/Classes/Controller/MapController.php index ff970e2c..b28ff5f5 100644 --- a/web/typo3conf/ext/ep_products/Classes/Controller/MapController.php +++ b/web/typo3conf/ext/ep_products/Classes/Controller/MapController.php @@ -89,6 +89,9 @@ class MapController extends ActionController { /** @var \EP\EpProducts\Domain\Model\Product $product */ $hotel = reset($product->getHotels()->toArray()); + if (!$hotel->isShowAsTeaser()) { + continue; + } $markerData[] = [ 'name' => $product->getName(), 'uri' => $this->getUriForPageUid($product->getDetailPage()), diff --git a/web/typo3conf/ext/ep_products/Classes/Domain/Model/Hotel.php b/web/typo3conf/ext/ep_products/Classes/Domain/Model/Hotel.php index 72ce1ca2..8c24a693 100644 --- a/web/typo3conf/ext/ep_products/Classes/Domain/Model/Hotel.php +++ b/web/typo3conf/ext/ep_products/Classes/Domain/Model/Hotel.php @@ -79,6 +79,11 @@ class Hotel extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity implements Te */ protected $lowContingent = false; + /** + * @var bool + */ + protected $showAsTeaser = false; + /** * @var int */ @@ -292,6 +297,22 @@ class Hotel extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity implements Te $this->lowContingent = $lowContingent; } + /** + * @return bool + */ + public function isShowAsTeaser() + { + return $this->showAsTeaser; + } + + /** + * @param bool $showAsTeaser + */ + public function setShowAsTeaser($showAsTeaser) + { + $this->showAsTeaser = $showAsTeaser; + } + /** * @return int */