Use constants for TCA select values

This commit is contained in:
Björn Fromme
2019-06-27 13:01:59 +02:00
parent 97643396f4
commit a45b3cb9da
9 changed files with 212 additions and 192 deletions
@@ -32,6 +32,11 @@ namespace EP\EpEvents\Domain\Model;
*/ */
class Activity extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity class Activity extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
{ {
const TYPE_OUTDOOR_ACTION = 1;
const TYPE_EVENTGASTRO = 2;
const TYPE_SIGHTSEEING = 3;
const TYPE_SPECIAL = 4;
/** /**
* @var array * @var array
*/ */
@@ -32,6 +32,11 @@ namespace EP\EpEvents\Domain\Model;
*/ */
class Hotel extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity class Hotel extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
{ {
const TYPE_3STARS = 1;
const TYPE_4STARS = 2;
const TYPE_5STARS = 3;
const TYPE_SPECIAL = 4;
/** /**
* name * name
* *
@@ -36,6 +36,11 @@ class Location extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
const DISTANCE_EUROPE = 2; const DISTANCE_EUROPE = 2;
const DISTANCE_WORLD = 3; const DISTANCE_WORLD = 3;
const TYPE_SEA = 1;
const TYPE_MOUNTAINS = 2;
const TYPE_CITIES = 3;
const TYPE_SPECIAL = 4;
/** /**
* name * name
* *
@@ -32,6 +32,11 @@ namespace EP\EpEvents\Domain\Model;
*/ */
class Traveltype extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity class Traveltype extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
{ {
const TYPE_INCENTIVE = 1;
const TYPE_TEAMBUILDING = 2;
const TYPE_MEETING = 3;
const TYPE_CORPORATE_EVENT = 4;
/** /**
* @var string * @var string
*/ */
@@ -293,12 +293,12 @@ return [
'type' => 'select', 'type' => 'select',
'renderType' => 'selectSingle', 'renderType' => 'selectSingle',
'items' => [ 'items' => [
['Outdoor & Action', 1], ['Outdoor & Action', \EP\EpEvents\Domain\Model\Activity::TYPE_OUTDOOR_ACTION],
['Event-Gastronomie', 2], ['Event-Gastronomie', \EP\EpEvents\Domain\Model\Activity::TYPE_EVENTGASTRO],
['Sightseeing', 3], ['Sightseeing', \EP\EpEvents\Domain\Model\Activity::TYPE_SIGHTSEEING],
['Spezial', 4], ['Spezial', \EP\EpEvents\Domain\Model\Activity::TYPE_SPECIAL],
], ],
'default' => 1, 'default' => \EP\EpEvents\Domain\Model\Activity::TYPE_OUTDOOR_ACTION,
'size' => 1, 'size' => 1,
'minitems' => 1, 'minitems' => 1,
'maxitems' => 1, 'maxitems' => 1,
@@ -219,12 +219,12 @@ return [
'type' => 'select', 'type' => 'select',
'renderType' => 'selectSingle', 'renderType' => 'selectSingle',
'items' => [ 'items' => [
['3-Sterne', 1], ['3-Sterne', \EP\EpEvents\Domain\Model\Hotel::TYPE_3STARS],
['4-Sterne', 2], ['4-Sterne', \EP\EpEvents\Domain\Model\Hotel::TYPE_4STARS],
['5-Sterne', 3], ['5-Sterne', \EP\EpEvents\Domain\Model\Hotel::TYPE_5STARS],
['Spezial', 4], ['Spezial', \EP\EpEvents\Domain\Model\Hotel::TYPE_SPECIAL],
], ],
'default' => 1, 'default' => \EP\EpEvents\Domain\Model\Hotel::TYPE_3STARS,
'size' => 1, 'size' => 1,
'minitems' => 1, 'minitems' => 1,
'maxitems' => 1, 'maxitems' => 1,
@@ -290,12 +290,12 @@ return [
'type' => 'select', 'type' => 'select',
'renderType' => 'selectSingle', 'renderType' => 'selectSingle',
'items' => [ 'items' => [
['Meer', 1], ['Meer', \EP\EpEvents\Domain\Model\Location::TYPE_SEA],
['Berge', 2], ['Berge', \EP\EpEvents\Domain\Model\Location::TYPE_MOUNTAINS],
['Städte', 3], ['Städte', \EP\EpEvents\Domain\Model\Location::TYPE_CITIES],
['Spezial', 4], ['Spezial', \EP\EpEvents\Domain\Model\Location::TYPE_SPECIAL],
], ],
'default' => 1, 'default' => \EP\EpEvents\Domain\Model\Location::TYPE_SEA,
'size' => 1, 'size' => 1,
'minitems' => 1, 'minitems' => 1,
'maxitems' => 1, 'maxitems' => 1,
@@ -310,9 +310,9 @@ return [
'type' => 'select', 'type' => 'select',
'renderType' => 'selectSingle', 'renderType' => 'selectSingle',
'items' => [ 'items' => [
[ 'Deutschland', \EP\EpEvents\Domain\Model\Location::DISTANCE_GERMANY ], ['Deutschland', \EP\EpEvents\Domain\Model\Location::DISTANCE_GERMANY],
[ 'Europa', \EP\EpEvents\Domain\Model\Location::DISTANCE_EUROPE ], ['Europa', \EP\EpEvents\Domain\Model\Location::DISTANCE_EUROPE],
[ 'Welt', \EP\EpEvents\Domain\Model\Location::DISTANCE_WORLD ], ['Welt', \EP\EpEvents\Domain\Model\Location::DISTANCE_WORLD],
] ]
], ],
], ],
@@ -408,12 +408,12 @@ return [
'type' => 'select', 'type' => 'select',
'renderType' => 'selectSingle', 'renderType' => 'selectSingle',
'items' => [ 'items' => [
['Incentive', 1], ['Incentive', \EP\EpEvents\Domain\Model\Traveltype::TYPE_INCENTIVE],
['Teambuilding', 2], ['Teambuilding', \EP\EpEvents\Domain\Model\Traveltype::TYPE_TEAMBUILDING],
['Meeting', 3], ['Meeting', \EP\EpEvents\Domain\Model\Traveltype::TYPE_MEETING],
['Corporate Event', 4], ['Corporate Event', \EP\EpEvents\Domain\Model\Traveltype::TYPE_CORPORATE_EVENT],
], ],
'default' => 1, 'default' => \EP\EpEvents\Domain\Model\Traveltype::TYPE_INCENTIVE,
'size' => 1, 'size' => 1,
'minitems' => 1, 'minitems' => 1,
'maxitems' => 1, 'maxitems' => 1,
@@ -279,12 +279,12 @@ return [
'type' => 'select', 'type' => 'select',
'renderType' => 'selectSingle', 'renderType' => 'selectSingle',
'items' => [ 'items' => [
['Incentive', 1], ['Incentive', \EP\EpEvents\Domain\Model\Traveltype::TYPE_INCENTIVE],
['Team Building', 2], ['Team Building', \EP\EpEvents\Domain\Model\Traveltype::TYPE_TEAMBUILDING],
['Meeting', 3], ['Meeting', \EP\EpEvents\Domain\Model\Traveltype::TYPE_MEETING],
['Corporate Event', 4], ['Corporate Event', \EP\EpEvents\Domain\Model\Traveltype::TYPE_CORPORATE_EVENT],
], ],
'default' => 1, 'default' => \EP\EpEvents\Domain\Model\Traveltype::TYPE_INCENTIVE,
'size' => 1, 'size' => 1,
'minitems' => 1, 'minitems' => 1,
'maxitems' => 1, 'maxitems' => 1,