diff --git a/public/typo3conf/ext/ep_products/Classes/Domain/Model/GroupsPriceBoard.php b/public/typo3conf/ext/ep_products/Classes/Domain/Model/GroupsPriceBoard.php index 7932cace..71c6fd21 100644 --- a/public/typo3conf/ext/ep_products/Classes/Domain/Model/GroupsPriceBoard.php +++ b/public/typo3conf/ext/ep_products/Classes/Domain/Model/GroupsPriceBoard.php @@ -29,7 +29,7 @@ use TYPO3\CMS\Extbase\DomainObject\AbstractEntity; * This copyright notice MUST APPEAR in all copies of the script! ***************************************************************/ -class GroupsPriceBoard extends AbstractEntity +class GroupsPriceBoard extends AbstractEntity implements \JsonSerializable { /** * @var string @@ -72,4 +72,15 @@ class GroupsPriceBoard extends AbstractEntity { $this->price = $price; } + + /** + * @return array + */ + public function jsonSerialize() + { + return [ + 'title' => $this->getTitle(), + 'price' => $this->getPrice(), + ]; + } } \ No newline at end of file diff --git a/public/typo3conf/ext/ep_products/Classes/Domain/Model/GroupsPriceConfig.php b/public/typo3conf/ext/ep_products/Classes/Domain/Model/GroupsPriceConfig.php index 8713cd45..a1b7d8ab 100644 --- a/public/typo3conf/ext/ep_products/Classes/Domain/Model/GroupsPriceConfig.php +++ b/public/typo3conf/ext/ep_products/Classes/Domain/Model/GroupsPriceConfig.php @@ -29,7 +29,7 @@ use TYPO3\CMS\Extbase\DomainObject\AbstractEntity; * This copyright notice MUST APPEAR in all copies of the script! ***************************************************************/ -class GroupsPriceConfig extends AbstractEntity +class GroupsPriceConfig extends AbstractEntity implements \JsonSerializable { /** * @var \DateTime @@ -135,4 +135,18 @@ class GroupsPriceConfig extends AbstractEntity { $this->priceAdditionalPerson = $priceAdditionalPerson; } + + /** + * @return array + */ + public function jsonSerialize() + { + return [ + 'dateFrom' => $this->getDateFrom()->format('d.m.Y'), + 'dateTo' => $this->getDateTo()->format('d.m.Y'), + 'personsIncluded' => $this->getPersonsIncluded(), + 'price' => $this->getPrice(), + 'priceAdditionalPerson' => $this->getPriceAdditionalPerson(), + ]; + } } \ No newline at end of file diff --git a/public/typo3conf/ext/ep_products/Classes/Domain/Model/GroupsPriceOption.php b/public/typo3conf/ext/ep_products/Classes/Domain/Model/GroupsPriceOption.php index 4fa0111d..63f4d534 100644 --- a/public/typo3conf/ext/ep_products/Classes/Domain/Model/GroupsPriceOption.php +++ b/public/typo3conf/ext/ep_products/Classes/Domain/Model/GroupsPriceOption.php @@ -29,7 +29,7 @@ use TYPO3\CMS\Extbase\DomainObject\AbstractEntity; * This copyright notice MUST APPEAR in all copies of the script! ***************************************************************/ -class GroupsPriceOption extends AbstractEntity +class GroupsPriceOption extends AbstractEntity implements \JsonSerializable { /** * @var string @@ -72,4 +72,15 @@ class GroupsPriceOption extends AbstractEntity { $this->price = $price; } + + /** + * @return array + */ + public function jsonSerialize() + { + return [ + 'title' => $this->getTitle(), + 'price' => $this->getPrice(), + ]; + } } \ No newline at end of file diff --git a/public/typo3conf/ext/ep_products/Classes/Domain/Model/Hotel.php b/public/typo3conf/ext/ep_products/Classes/Domain/Model/Hotel.php index 9e73e522..7151ecb5 100644 --- a/public/typo3conf/ext/ep_products/Classes/Domain/Model/Hotel.php +++ b/public/typo3conf/ext/ep_products/Classes/Domain/Model/Hotel.php @@ -169,22 +169,22 @@ class Hotel extends AbstractEntity implements TeaserInterface protected $address = ''; /** - * @var ObjectStorage + * @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\TYPO3\CMS\Extbase\Domain\Model\FileReference> */ protected $images; /** - * @var ObjectStorage + * @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\TYPO3\CMS\Extbase\Domain\Model\FileReference> */ protected $resellerImages; /** - * @var ObjectStorage + * @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\TYPO3\CMS\Extbase\Domain\Model\FileReference> */ protected $teaserImages; /** - * @var ObjectStorage + * @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\TYPO3\CMS\Extbase\Domain\Model\FileReference> */ protected $headerImages; @@ -194,7 +194,7 @@ class Hotel extends AbstractEntity implements TeaserInterface protected $code = ''; /** - * @var ObjectStorage + * @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\EP\EpProducts\Domain\Model\MatchCode> * @TYPO3\CMS\Extbase\Annotation\ORM\Lazy */ protected $additionalCodes; @@ -210,32 +210,32 @@ class Hotel extends AbstractEntity implements TeaserInterface protected $category = self::CATEGORY_STANDARD; /** - * @var Country + * @var \EP\EpProducts\Domain\Model\Country */ protected $country; /** - * @var Region + * @var \EP\EpProducts\Domain\Model\Region */ protected $region; /** - * @var City + * @var \EP\EpProducts\Domain\Model\City */ protected $city; /** - * @var ObjectStorage + * @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\EP\EpProducts\Domain\Model\Teammember> */ protected $teamer; /** - * @var ObjectStorage + * @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\EP\EpProducts\Domain\Model\Product> */ protected $products; /** - * @var ObjectStorage + * @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\EP\EpProducts\Domain\Model\Fact> */ protected $facts; @@ -250,20 +250,17 @@ class Hotel extends AbstractEntity implements TeaserInterface protected $pathSegment; /** - * @var ObjectStorage - * @TYPO3\CMS\Extbase\Annotation\ORM\Lazy + * @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\EP\EpProducts\Domain\Model\GroupsPriceConfig> */ protected $groupsPriceConfigs; /** - * @var ObjectStorage - * @TYPO3\CMS\Extbase\Annotation\ORM\Lazy + * @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\EP\EpProducts\Domain\Model\GroupsPriceOption> */ protected $groupsPriceOptions; /** - * @var ObjectStorage - * @TYPO3\CMS\Extbase\Annotation\ORM\Lazy + * @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\EP\EpProducts\Domain\Model\GroupsPriceBoard> */ protected $groupsPriceBoards; @@ -283,6 +280,8 @@ class Hotel extends AbstractEntity implements TeaserInterface $this->facts = new ObjectStorage(); $this->additionalCodes = new ObjectStorage(); $this->groupsPriceConfigs = new ObjectStorage(); + $this->groupsPriceOptions = new ObjectStorage(); + $this->groupsPriceBoards = new ObjectStorage(); } /** @@ -862,7 +861,7 @@ class Hotel extends AbstractEntity implements TeaserInterface } /** - * @return ObjectStorage $teamer + * @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage $teamer */ public function getTeamer() { @@ -870,7 +869,7 @@ class Hotel extends AbstractEntity implements TeaserInterface } /** - * @param ObjectStorage $teamer + * @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage $teamer */ public function setTeamer(ObjectStorage $teamer) { @@ -894,7 +893,7 @@ class Hotel extends AbstractEntity implements TeaserInterface } /** - * @return ObjectStorage + * @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage */ public function getProducts() { @@ -902,7 +901,7 @@ class Hotel extends AbstractEntity implements TeaserInterface } /** - * @param ObjectStorage $products + * @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage $products */ public function setProducts(ObjectStorage $products) { @@ -910,7 +909,7 @@ class Hotel extends AbstractEntity implements TeaserInterface } /** - * @param ObjectStorage $rooms + * @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage $rooms */ public function setRooms($rooms) { $this->rooms = $rooms; @@ -933,7 +932,7 @@ class Hotel extends AbstractEntity implements TeaserInterface } /** - * @return ObjectStorage + * @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage */ public function getFacts() { @@ -941,7 +940,7 @@ class Hotel extends AbstractEntity implements TeaserInterface } /** - * @param ObjectStorage $facts + * @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage $facts */ public function setFacts(ObjectStorage $facts) { @@ -997,7 +996,7 @@ class Hotel extends AbstractEntity implements TeaserInterface } /** - * @return ObjectStorage + * @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage */ public function getGroupsPriceConfigs() { @@ -1005,7 +1004,7 @@ class Hotel extends AbstractEntity implements TeaserInterface } /** - * @param ObjectStorage $groupPriceConfigs + * @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage $groupPriceConfigs */ public function setGroupsPriceConfigs(ObjectStorage $groupPriceConfigs) { @@ -1013,7 +1012,7 @@ class Hotel extends AbstractEntity implements TeaserInterface } /** - * @return ObjectStorage + * @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage */ public function getGroupsPriceOptions() { @@ -1021,7 +1020,7 @@ class Hotel extends AbstractEntity implements TeaserInterface } /** - * @param ObjectStorage $groupsPriceOptions + * @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage $groupsPriceOptions */ public function setGroupsPriceOptions(ObjectStorage $groupsPriceOptions) { @@ -1029,7 +1028,7 @@ class Hotel extends AbstractEntity implements TeaserInterface } /** - * @return ObjectStorage + * @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage */ public function getGroupsPriceBoards() { @@ -1037,7 +1036,7 @@ class Hotel extends AbstractEntity implements TeaserInterface } /** - * @param ObjectStorage $groupsPriceBoards + * @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage $groupsPriceBoards */ public function setGroupsPriceBoards(ObjectStorage $groupsPriceBoards) { diff --git a/public/typo3conf/ext/ep_products/Classes/Service/LabelService.php b/public/typo3conf/ext/ep_products/Classes/Service/LabelService.php index 110707ed..b9e3e38b 100644 --- a/public/typo3conf/ext/ep_products/Classes/Service/LabelService.php +++ b/public/typo3conf/ext/ep_products/Classes/Service/LabelService.php @@ -99,7 +99,7 @@ class LabelService */ public function getGroupsPriceConfigLabel(&$parameters, $parentObject) { - $record = BackendUtility::getRecord('tx_epproducts_domain_model_groups_price_config', $parameters['row']['uid']); + $record = BackendUtility::getRecord('tx_epproducts_domain_model_groupspriceconfig', $parameters['row']['uid']); $parameters['title'] = sprintf('%s - %s', date('d.m.Y', $record['date_from']), date('d.m.Y', $record['date_to'])); } } diff --git a/public/typo3conf/ext/ep_products/Configuration/TCA/tx_epproducts_domain_model_groups_price_board.php b/public/typo3conf/ext/ep_products/Configuration/TCA/tx_epproducts_domain_model_groupspriceboard.php similarity index 97% rename from public/typo3conf/ext/ep_products/Configuration/TCA/tx_epproducts_domain_model_groups_price_board.php rename to public/typo3conf/ext/ep_products/Configuration/TCA/tx_epproducts_domain_model_groupspriceboard.php index cd498cb2..cf687993 100644 --- a/public/typo3conf/ext/ep_products/Configuration/TCA/tx_epproducts_domain_model_groups_price_board.php +++ b/public/typo3conf/ext/ep_products/Configuration/TCA/tx_epproducts_domain_model_groupspriceboard.php @@ -59,8 +59,8 @@ return [ 'items' => [ ['', 0], ], - 'foreign_table' => 'tx_epproducts_domain_model_groups_price_board', - 'foreign_table_where' => 'AND tx_epproducts_domain_model_groups_price_board.pid=###CURRENT_PID### AND tx_epproducts_domain_model_groups_price_board.sys_language_uid IN (-1,0)', + 'foreign_table' => 'tx_epproducts_domain_model_groupspriceboard', + 'foreign_table_where' => 'AND tx_epproducts_domain_model_groupspriceboard.pid=###CURRENT_PID### AND tx_epproducts_domain_model_groupspriceboard.sys_language_uid IN (-1,0)', ], ], 'l10n_diffsource' => [ diff --git a/public/typo3conf/ext/ep_products/Configuration/TCA/tx_epproducts_domain_model_groups_price_config.php b/public/typo3conf/ext/ep_products/Configuration/TCA/tx_epproducts_domain_model_groupspriceconfig.php similarity index 97% rename from public/typo3conf/ext/ep_products/Configuration/TCA/tx_epproducts_domain_model_groups_price_config.php rename to public/typo3conf/ext/ep_products/Configuration/TCA/tx_epproducts_domain_model_groupspriceconfig.php index 4939cf46..f66297d1 100644 --- a/public/typo3conf/ext/ep_products/Configuration/TCA/tx_epproducts_domain_model_groups_price_config.php +++ b/public/typo3conf/ext/ep_products/Configuration/TCA/tx_epproducts_domain_model_groupspriceconfig.php @@ -62,8 +62,8 @@ return [ 'items' => [ ['', 0], ], - 'foreign_table' => 'tx_epproducts_domain_model_groups_price_config', - 'foreign_table_where' => 'AND tx_epproducts_domain_model_groups_price_config.pid=###CURRENT_PID### AND tx_epproducts_domain_model_groups_price_config.sys_language_uid IN (-1,0)', + 'foreign_table' => 'tx_epproducts_domain_model_groupspriceconfig', + 'foreign_table_where' => 'AND tx_epproducts_domain_model_groupspriceconfig.pid=###CURRENT_PID### AND tx_epproducts_domain_model_groupspriceconfig.sys_language_uid IN (-1,0)', ], ], 'l10n_diffsource' => [ diff --git a/public/typo3conf/ext/ep_products/Configuration/TCA/tx_epproducts_domain_model_groups_price_option.php b/public/typo3conf/ext/ep_products/Configuration/TCA/tx_epproducts_domain_model_groupspriceoption.php similarity index 97% rename from public/typo3conf/ext/ep_products/Configuration/TCA/tx_epproducts_domain_model_groups_price_option.php rename to public/typo3conf/ext/ep_products/Configuration/TCA/tx_epproducts_domain_model_groupspriceoption.php index 523eaab2..7808a59b 100644 --- a/public/typo3conf/ext/ep_products/Configuration/TCA/tx_epproducts_domain_model_groups_price_option.php +++ b/public/typo3conf/ext/ep_products/Configuration/TCA/tx_epproducts_domain_model_groupspriceoption.php @@ -59,8 +59,8 @@ return [ 'items' => [ ['', 0], ], - 'foreign_table' => 'tx_epproducts_domain_model_groups_price_option', - 'foreign_table_where' => 'AND tx_epproducts_domain_model_groups_price_option.pid=###CURRENT_PID### AND tx_epproducts_domain_model_groups_price_option.sys_language_uid IN (-1,0)', + 'foreign_table' => 'tx_epproducts_domain_model_groupspriceoption', + 'foreign_table_where' => 'AND tx_epproducts_domain_model_groupspriceoption.pid=###CURRENT_PID### AND tx_epproducts_domain_model_groupspriceoption.sys_language_uid IN (-1,0)', ], ], 'l10n_diffsource' => [ diff --git a/public/typo3conf/ext/ep_products/Configuration/TCA/tx_epproducts_domain_model_hotel.php b/public/typo3conf/ext/ep_products/Configuration/TCA/tx_epproducts_domain_model_hotel.php index 1caf5d57..48bd6326 100644 --- a/public/typo3conf/ext/ep_products/Configuration/TCA/tx_epproducts_domain_model_hotel.php +++ b/public/typo3conf/ext/ep_products/Configuration/TCA/tx_epproducts_domain_model_hotel.php @@ -660,7 +660,7 @@ return [ 'label' => 'Preiskonfigurationen', 'config' => [ 'type' => 'inline', - 'foreign_table' => 'tx_epproducts_domain_model_groups_price_config', + 'foreign_table' => 'tx_epproducts_domain_model_groupspriceconfig', 'foreign_field' => 'hotel', 'maxitems' => 99, 'minitems' => 0, @@ -679,7 +679,7 @@ return [ 'label' => 'Verpflegungsleistungen', 'config' => [ 'type' => 'inline', - 'foreign_table' => 'tx_epproducts_domain_model_groups_price_board', + 'foreign_table' => 'tx_epproducts_domain_model_groupspriceboard', 'foreign_field' => 'hotel', 'maxitems' => 99, 'minitems' => 0, @@ -699,7 +699,7 @@ return [ 'label' => 'Optionale Zusatzleistungen', 'config' => [ 'type' => 'inline', - 'foreign_table' => 'tx_epproducts_domain_model_groups_price_option', + 'foreign_table' => 'tx_epproducts_domain_model_groupspriceoption', 'foreign_field' => 'hotel', 'maxitems' => 99, 'minitems' => 0, diff --git a/public/typo3conf/ext/ep_products/ext_tables.sql b/public/typo3conf/ext/ep_products/ext_tables.sql index 9a7c3b79..7bccd587 100644 --- a/public/typo3conf/ext/ep_products/ext_tables.sql +++ b/public/typo3conf/ext/ep_products/ext_tables.sql @@ -272,9 +272,9 @@ CREATE TABLE tx_epproducts_domain_model_hotel ); # -# Table structure for table 'tx_epproducts_domain_model_groups_price_config' +# Table structure for table 'tx_epproducts_domain_model_groupspriceconfig' # -CREATE TABLE tx_epproducts_domain_model_groups_price_config +CREATE TABLE tx_epproducts_domain_model_groupspriceconfig ( uid int(11) NOT NULL auto_increment, @@ -317,9 +317,9 @@ CREATE TABLE tx_epproducts_domain_model_groups_price_config ); # -# Table structure for table 'tx_epproducts_domain_model_groups_price_option' +# Table structure for table 'tx_epproducts_domain_model_groupspriceoption' # -CREATE TABLE tx_epproducts_domain_model_groups_price_option +CREATE TABLE tx_epproducts_domain_model_groupspriceoption ( uid int(11) NOT NULL auto_increment, @@ -360,9 +360,9 @@ CREATE TABLE tx_epproducts_domain_model_groups_price_option ); # -# Table structure for table 'tx_epproducts_domain_model_groups_price_board' +# Table structure for table 'tx_epproducts_domain_model_groupspriceboard' # -CREATE TABLE tx_epproducts_domain_model_groups_price_board +CREATE TABLE tx_epproducts_domain_model_groupspriceboard ( uid int(11) NOT NULL auto_increment,