Allow to reference events from event

This might be useful to allow editors and integrators to create
something like "you might also be interested in" or "related events".
This commit is contained in:
Daniel Siepmann 2021-07-13 09:31:01 +02:00
parent 97bcbe2065
commit 326378e2fc
5 changed files with 38 additions and 0 deletions

View file

@ -217,6 +217,11 @@ class Event extends AbstractEntity
*/
protected $partner;
/**
* @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<Event>
*/
protected $referencesEvents;
/**
* @var int
*/
@ -251,6 +256,7 @@ class Event extends AbstractEntity
protected function initStorageObjects()
{
$this->dates = new ObjectStorage();
$this->referencesEvents = new ObjectStorage();
}
/**
@ -674,6 +680,14 @@ class Event extends AbstractEntity
return $this->partner;
}
/**
* @return ObjectStorage<Event>
*/
public function getReferencesEvents(): ObjectStorage
{
return $this->referencesEvents;
}
/**
* @param \Wrm\Events\Domain\Model\Organizer $organizer
* @return void

View file

@ -63,6 +63,7 @@ return [
region,
partner,
categories,
references_events,
pages,
--div--;' . $l10nPath . ':tx_events_domain_model_event.tabs.media,
images,
@ -524,6 +525,21 @@ return [
],
],
'references_events' => [
'exclude' => true,
'label' => $l10nPath . ':tx_events_domain_model_event.references_events',
'config' => [
'type' => 'group',
'internal_type' => 'db',
'allowed' => 'tx_events_domain_model_event',
'suggestOptions' => [
'tx_events_domain_model_event' => [
'searchCondition' => 'tx_events_domain_model_event.sys_language_uid IN (0, -1)',
],
],
],
],
'partner' => [
'exclude' => true,
'label' => $l10nPath . ':tx_events_domain_model_event.partner',

View file

@ -159,6 +159,10 @@
<source>Partner</source>
<target>Partner</target>
</trans-unit>
<trans-unit id="tx_events_domain_model_event.references_events">
<source>Related Events</source>
<target>Ähnliche Veranstaltungen</target>
</trans-unit>
</body>
</file>
</xliff>

View file

@ -117,6 +117,9 @@
<trans-unit id="tx_events_domain_model_event.partner">
<source>Partner</source>
</trans-unit>
<trans-unit id="tx_events_domain_model_event.references_events">
<source>Related Events</source>
</trans-unit>
</body>
</file>
</xliff>

View file

@ -32,6 +32,7 @@ CREATE TABLE tx_events_domain_model_event (
organizer int(11) unsigned DEFAULT '0',
partner text,
region int(11) unsigned DEFAULT '0',
references_events text,
KEY dataHandler (l10n_parent, t3ver_oid, deleted, t3ver_wsid, t3ver_state)
);