Add discriminator property to products

This commit is contained in:
Björn Fromme
2020-02-05 11:33:09 +01:00
parent 40c137b571
commit 7b008804bf
3 changed files with 33 additions and 3 deletions
@@ -40,6 +40,11 @@ class Product extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity implements
*/ */
protected $bookable = true; protected $bookable = true;
/**
* @var bool
*/
protected $hideBookingButton = false;
/** /**
* @var bool * @var bool
*/ */
@@ -302,6 +307,22 @@ class Product extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity implements
$this->bookable = (bool) $bookable; $this->bookable = (bool) $bookable;
} }
/**
* @return bool
*/
public function getHideBookingButton()
{
return $this->hideBookingButton;
}
/**
* @param bool $hideBookingButton
*/
public function setHideBookingButton($hideBookingButton)
{
$this->hideBookingButton = (bool) $hideBookingButton;
}
/** /**
* @return bool * @return bool
*/ */
@@ -28,7 +28,8 @@ return [
concept_description, board_description, additional_services, programme_description, ski_pass_description, concept_description, board_description, additional_services, programme_description, ski_pass_description,
rating_average, rating_votes_count, teaser_images, header_images, images, concept, country, region, city, rating_average, rating_votes_count, teaser_images, header_images, images, concept, country, region, city,
journey, facts, officetip, hotels, calendar_hotel, faqs,header_title,header_subtitle, alt_product, alt_label, journey, facts, officetip, hotels, calendar_hotel, faqs,header_title,header_subtitle, alt_product, alt_label,
video, banner, additional_regions, badge, daytrip, testimonials, external_link, path_segment', video, banner, additional_regions, badge, daytrip, testimonials, external_link, path_segment,
hide_booking_button',
], ],
'types' => [ 'types' => [
'1' => [ '1' => [
@@ -44,8 +45,8 @@ return [
], ],
'palettes' => [ 'palettes' => [
'destinations' => ['showitem' => 'country,region,city'], 'destinations' => ['showitem' => 'country,region,city'],
'top' => ['showitem' => 'searchable, bookable, daytrip, important, skipass_included, detail_page, 'top' => ['showitem' => 'searchable, bookable, hide_booking_button, daytrip, important, skipass_included,
external_link, path_segment'], detail_page, external_link, path_segment'],
'name' => ['showitem' => 'name,code'], 'name' => ['showitem' => 'name,code'],
'alternative' => ['showitem' => 'alt_product, alt_label'], 'alternative' => ['showitem' => 'alt_product, alt_label'],
'header' => ['showitem' => 'headline,subline,--linebreak--,header_title,header_subtitle'], 'header' => ['showitem' => 'headline,subline,--linebreak--,header_title,header_subtitle'],
@@ -155,6 +156,13 @@ return [
'type' => 'check', 'type' => 'check',
], ],
], ],
'hide_booking_button' => [
'exclude' => 0,
'label' => 'Buchungsbutton verstecken',
'config' => [
'type' => 'check',
],
],
'daytrip' => [ 'daytrip' => [
'exclude' => 0, 'exclude' => 0,
'label' => 'tageweise buchbar', 'label' => 'tageweise buchbar',
@@ -10,6 +10,7 @@ CREATE TABLE tx_epproducts_domain_model_product
searchable tinyint(4) unsigned DEFAULT '1' NOT NULL, searchable tinyint(4) unsigned DEFAULT '1' NOT NULL,
bookable tinyint(4) unsigned DEFAULT '1' NOT NULL, bookable tinyint(4) unsigned DEFAULT '1' NOT NULL,
hide_booking_button tinyint(4) unsigned DEFAULT '0' NOT NULL,
daytrip tinyint(4) unsigned DEFAULT '0' NOT NULL, daytrip tinyint(4) unsigned DEFAULT '0' NOT NULL,
important tinyint(4) unsigned DEFAULT '0' NOT NULL, important tinyint(4) unsigned DEFAULT '0' NOT NULL,
skipass_included tinyint(4) unsigned DEFAULT '1' NOT NULL, skipass_included tinyint(4) unsigned DEFAULT '1' NOT NULL,