2019-07-18 13:44:19 +02:00
|
|
|
<?php
|
2021-01-07 08:50:43 +01:00
|
|
|
|
2019-07-18 13:44:19 +02:00
|
|
|
namespace Wrm\Events\Domain\Model;
|
|
|
|
|
|
|
|
use TYPO3\CMS\Extbase\Annotation as Extbase;
|
2021-01-07 08:58:03 +01:00
|
|
|
use TYPO3\CMS\Extbase\Domain\Model\FileReference;
|
2021-09-07 09:03:02 +02:00
|
|
|
use TYPO3\CMS\Extbase\DomainObject\AbstractEntity;
|
2019-07-18 13:44:19 +02:00
|
|
|
use TYPO3\CMS\Extbase\Object\ObjectManager;
|
2021-01-07 08:50:43 +01:00
|
|
|
use TYPO3\CMS\Extbase\Persistence\ObjectStorage;
|
2021-01-07 08:58:03 +01:00
|
|
|
use Wrm\Events\Domain\Repository\DateRepository;
|
2021-01-11 09:20:51 +01:00
|
|
|
use Wrm\Events\Service\DataProcessingForModels;
|
2019-07-18 13:44:19 +02:00
|
|
|
|
|
|
|
class Event extends AbstractEntity
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* @var string
|
|
|
|
*/
|
|
|
|
protected $title = '';
|
|
|
|
|
2021-02-15 09:58:51 +01:00
|
|
|
/**
|
|
|
|
* @var string
|
|
|
|
*/
|
|
|
|
protected $subtitle = '';
|
|
|
|
|
2019-07-18 13:44:19 +02:00
|
|
|
/**
|
|
|
|
* @var string
|
|
|
|
*/
|
|
|
|
protected $globalId = '';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @var string
|
|
|
|
*/
|
|
|
|
protected $slug = '';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @var bool
|
|
|
|
*/
|
|
|
|
protected $highlight = false;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @var string
|
|
|
|
*/
|
|
|
|
protected $teaser = '';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @var string
|
|
|
|
*/
|
|
|
|
protected $details = '';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @var string
|
|
|
|
*/
|
|
|
|
protected $priceInfo = '';
|
|
|
|
|
2020-08-17 14:21:03 +02:00
|
|
|
/**
|
|
|
|
* @var string
|
|
|
|
*/
|
2022-08-02 15:56:18 +02:00
|
|
|
protected $web = '';
|
2020-08-17 14:21:03 +02:00
|
|
|
|
2019-07-18 13:44:19 +02:00
|
|
|
/**
|
|
|
|
* @var string
|
|
|
|
*/
|
2022-08-02 15:56:18 +02:00
|
|
|
protected $ticket = '';
|
2019-07-18 13:44:19 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @var string
|
|
|
|
*/
|
2022-08-02 15:56:18 +02:00
|
|
|
protected $facebook = '';
|
2019-07-18 13:44:19 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @var string
|
|
|
|
*/
|
2022-08-02 15:56:18 +02:00
|
|
|
protected $youtube = '';
|
2019-07-18 13:44:19 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @var string
|
|
|
|
*/
|
2022-08-02 15:56:18 +02:00
|
|
|
protected $instagram = '';
|
2019-07-18 13:44:19 +02:00
|
|
|
|
|
|
|
/**
|
2022-08-02 15:56:18 +02:00
|
|
|
* @var ObjectStorage<FileReference>
|
|
|
|
* @Extbase\ORM\Cascade remove
|
2019-07-18 13:44:19 +02:00
|
|
|
*/
|
2022-08-02 15:56:18 +02:00
|
|
|
protected $images;
|
2019-07-18 13:44:19 +02:00
|
|
|
|
2020-03-16 13:52:58 +01:00
|
|
|
/**
|
2022-08-02 15:56:18 +02:00
|
|
|
* @var ObjectStorage<Date>
|
|
|
|
* @Extbase\ORM\Cascade remove
|
|
|
|
* @Extbase\ORM\Lazy
|
2020-03-16 13:52:58 +01:00
|
|
|
*/
|
2022-08-02 15:56:18 +02:00
|
|
|
protected $dates;
|
2020-03-16 13:52:58 +01:00
|
|
|
|
2019-07-18 13:44:19 +02:00
|
|
|
/**
|
2022-08-02 15:56:18 +02:00
|
|
|
* @var Location|null
|
2019-07-18 13:44:19 +02:00
|
|
|
*/
|
2022-08-02 15:56:18 +02:00
|
|
|
protected $location = null;
|
2019-07-18 13:44:19 +02:00
|
|
|
|
|
|
|
/**
|
2022-08-02 15:56:18 +02:00
|
|
|
* @var Organizer|null
|
2019-07-18 13:44:19 +02:00
|
|
|
*/
|
2022-08-02 15:56:18 +02:00
|
|
|
protected $organizer = null;
|
2019-07-18 13:44:19 +02:00
|
|
|
|
|
|
|
/**
|
2022-08-02 15:56:18 +02:00
|
|
|
* @var Region|null
|
2019-07-18 13:44:19 +02:00
|
|
|
*/
|
2022-08-02 15:56:18 +02:00
|
|
|
protected $region = null;
|
2019-07-18 13:44:19 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @var string
|
|
|
|
*/
|
2022-08-02 15:56:18 +02:00
|
|
|
protected $pages = '';
|
2019-07-18 13:44:19 +02:00
|
|
|
|
2020-08-19 11:30:13 +02:00
|
|
|
/**
|
2022-08-02 15:56:18 +02:00
|
|
|
* @var ObjectStorage<Category>
|
2020-08-19 11:30:13 +02:00
|
|
|
*/
|
2022-08-02 15:56:18 +02:00
|
|
|
protected $categories;
|
2020-08-19 11:30:13 +02:00
|
|
|
|
2019-07-18 13:44:19 +02:00
|
|
|
/**
|
2022-08-02 15:56:18 +02:00
|
|
|
* @var ObjectStorage<Category>
|
2019-07-18 13:44:19 +02:00
|
|
|
*/
|
2022-08-02 15:56:18 +02:00
|
|
|
protected $features;
|
2019-07-18 13:44:19 +02:00
|
|
|
|
|
|
|
/**
|
2022-08-02 15:56:18 +02:00
|
|
|
* @var ObjectStorage<Partner>
|
2019-07-18 13:44:19 +02:00
|
|
|
*/
|
2022-08-02 15:56:18 +02:00
|
|
|
protected $partner;
|
2019-07-18 13:44:19 +02:00
|
|
|
|
|
|
|
/**
|
2022-08-02 15:56:18 +02:00
|
|
|
* @var ObjectStorage<Event>
|
2019-07-18 13:44:19 +02:00
|
|
|
*/
|
2022-08-02 15:56:18 +02:00
|
|
|
protected $referencesEvents;
|
2019-07-18 13:44:19 +02:00
|
|
|
|
|
|
|
/**
|
2022-08-02 15:56:18 +02:00
|
|
|
* @var int
|
2019-07-18 13:44:19 +02:00
|
|
|
*/
|
2022-08-02 15:56:18 +02:00
|
|
|
protected $_languageUid;
|
2019-07-18 13:44:19 +02:00
|
|
|
|
|
|
|
/**
|
2022-08-02 15:56:18 +02:00
|
|
|
* @var DataProcessingForModels
|
2019-07-18 13:44:19 +02:00
|
|
|
*/
|
2022-08-02 15:56:18 +02:00
|
|
|
protected $dataProcessing = null;
|
|
|
|
|
|
|
|
// Legacy location related info
|
2019-07-18 13:44:19 +02:00
|
|
|
|
|
|
|
/**
|
2022-08-02 15:56:18 +02:00
|
|
|
* @var string
|
2019-07-18 13:44:19 +02:00
|
|
|
*/
|
2022-08-02 15:56:18 +02:00
|
|
|
protected $name = '';
|
2019-07-18 13:44:19 +02:00
|
|
|
|
2021-01-11 09:20:51 +01:00
|
|
|
/**
|
|
|
|
* @var string
|
|
|
|
*/
|
2022-08-02 15:56:18 +02:00
|
|
|
protected $street = '';
|
2021-01-11 09:20:51 +01:00
|
|
|
|
2019-07-18 13:44:19 +02:00
|
|
|
/**
|
2022-08-02 15:56:18 +02:00
|
|
|
* @var string
|
2019-07-18 13:44:19 +02:00
|
|
|
*/
|
2022-08-02 15:56:18 +02:00
|
|
|
protected $district = '';
|
2019-07-18 13:44:19 +02:00
|
|
|
|
2022-07-05 14:08:14 +02:00
|
|
|
/**
|
2022-08-02 15:56:18 +02:00
|
|
|
* @var string
|
2022-07-05 14:08:14 +02:00
|
|
|
*/
|
2022-08-02 15:56:18 +02:00
|
|
|
protected $city = '';
|
2022-07-05 14:08:14 +02:00
|
|
|
|
2021-01-11 10:15:21 +01:00
|
|
|
/**
|
2022-08-02 15:56:18 +02:00
|
|
|
* @var string
|
2021-01-11 10:15:21 +01:00
|
|
|
*/
|
2022-08-02 15:56:18 +02:00
|
|
|
protected $zip = '';
|
2021-01-11 10:15:21 +01:00
|
|
|
|
2021-07-13 09:31:01 +02:00
|
|
|
/**
|
2022-08-02 15:56:18 +02:00
|
|
|
* @var string
|
2021-07-13 09:31:01 +02:00
|
|
|
*/
|
2022-08-02 15:56:18 +02:00
|
|
|
protected $country = '';
|
2021-07-13 09:31:01 +02:00
|
|
|
|
2020-10-01 08:34:13 +02:00
|
|
|
/**
|
2022-08-02 15:56:18 +02:00
|
|
|
* @var string
|
2020-10-01 08:34:13 +02:00
|
|
|
*/
|
2022-08-02 15:56:18 +02:00
|
|
|
protected $phone = '';
|
2020-10-01 08:34:13 +02:00
|
|
|
|
2021-01-11 09:20:51 +01:00
|
|
|
/**
|
2022-08-02 15:56:18 +02:00
|
|
|
* @var string
|
2021-01-11 09:20:51 +01:00
|
|
|
*/
|
2022-08-02 15:56:18 +02:00
|
|
|
protected $latitude = '';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @var string
|
|
|
|
*/
|
|
|
|
protected $longitude = '';
|
|
|
|
|
|
|
|
// End of legacy location info
|
2021-01-11 09:20:51 +01:00
|
|
|
|
2019-07-18 13:44:19 +02:00
|
|
|
public function __construct()
|
|
|
|
{
|
|
|
|
$this->initStorageObjects();
|
|
|
|
}
|
|
|
|
|
2021-01-11 09:20:51 +01:00
|
|
|
/**
|
|
|
|
* @param DataProcessingForModels $dataProcessing
|
|
|
|
*/
|
2021-09-07 09:52:14 +02:00
|
|
|
public function injectDataProcessingForModels(DataProcessingForModels $dataProcessing): void
|
2021-01-11 09:20:51 +01:00
|
|
|
{
|
|
|
|
$this->dataProcessing = $dataProcessing;
|
|
|
|
}
|
|
|
|
|
2021-09-07 09:52:14 +02:00
|
|
|
public function initializeObject(): void
|
2021-07-13 09:31:42 +02:00
|
|
|
{
|
|
|
|
$this->initStorageObjects();
|
|
|
|
}
|
|
|
|
|
2021-09-07 09:52:14 +02:00
|
|
|
protected function initStorageObjects(): void
|
2019-07-18 13:44:19 +02:00
|
|
|
{
|
2021-09-06 16:33:18 +02:00
|
|
|
$this->images = new ObjectStorage();
|
2019-07-18 13:44:19 +02:00
|
|
|
$this->dates = new ObjectStorage();
|
2021-09-06 16:33:18 +02:00
|
|
|
$this->categories = new ObjectStorage();
|
2022-07-05 14:08:14 +02:00
|
|
|
$this->features = new ObjectStorage();
|
2021-09-06 16:33:18 +02:00
|
|
|
$this->partner = new ObjectStorage();
|
2021-07-13 09:31:01 +02:00
|
|
|
$this->referencesEvents = new ObjectStorage();
|
2019-07-18 13:44:19 +02:00
|
|
|
}
|
|
|
|
|
2021-09-07 09:52:14 +02:00
|
|
|
public function getGlobalId(): string
|
2019-07-18 13:44:19 +02:00
|
|
|
{
|
|
|
|
return $this->globalId;
|
|
|
|
}
|
|
|
|
|
2021-09-07 09:52:14 +02:00
|
|
|
public function setGlobalId(string $globalId): void
|
2019-07-18 13:44:19 +02:00
|
|
|
{
|
|
|
|
$this->globalId = $globalId;
|
|
|
|
}
|
|
|
|
|
2021-09-07 09:52:14 +02:00
|
|
|
public function getTitle(): string
|
2019-07-18 13:44:19 +02:00
|
|
|
{
|
|
|
|
return $this->title;
|
|
|
|
}
|
|
|
|
|
2021-09-07 09:52:14 +02:00
|
|
|
public function setTitle(string $title): void
|
2019-07-18 13:44:19 +02:00
|
|
|
{
|
|
|
|
$this->title = $title;
|
|
|
|
}
|
|
|
|
|
2021-09-07 09:52:14 +02:00
|
|
|
public function getSubtitle(): string
|
2021-02-15 09:58:51 +01:00
|
|
|
{
|
|
|
|
return $this->subtitle;
|
|
|
|
}
|
|
|
|
|
2021-09-07 09:52:14 +02:00
|
|
|
public function setSubtitle(string $subtitle): void
|
2021-02-15 09:58:51 +01:00
|
|
|
{
|
|
|
|
$this->subtitle = $subtitle;
|
|
|
|
}
|
|
|
|
|
2021-09-07 09:52:14 +02:00
|
|
|
public function getTeaser(): string
|
2019-07-18 13:44:19 +02:00
|
|
|
{
|
|
|
|
return $this->teaser;
|
|
|
|
}
|
|
|
|
|
2021-09-07 09:52:14 +02:00
|
|
|
public function setTeaser(string $teaser): void
|
2019-07-18 13:44:19 +02:00
|
|
|
{
|
|
|
|
$this->teaser = $teaser;
|
|
|
|
}
|
|
|
|
|
2021-09-07 09:52:14 +02:00
|
|
|
public function getDetails(): string
|
2019-07-18 13:44:19 +02:00
|
|
|
{
|
|
|
|
return $this->details;
|
|
|
|
}
|
|
|
|
|
2021-09-07 09:52:14 +02:00
|
|
|
public function setDetails(string $details): void
|
2019-07-18 13:44:19 +02:00
|
|
|
{
|
|
|
|
$this->details = $details;
|
|
|
|
}
|
|
|
|
|
2021-09-07 09:52:14 +02:00
|
|
|
public function getPriceInfo(): string
|
2019-07-18 13:44:19 +02:00
|
|
|
{
|
|
|
|
return $this->priceInfo;
|
|
|
|
}
|
|
|
|
|
2021-09-07 09:52:14 +02:00
|
|
|
public function setPriceInfo(string $priceInfo): void
|
2019-07-18 13:44:19 +02:00
|
|
|
{
|
|
|
|
$this->priceInfo = $priceInfo;
|
|
|
|
}
|
|
|
|
|
2021-09-07 09:52:14 +02:00
|
|
|
public function getWeb(): string
|
2019-07-18 13:44:19 +02:00
|
|
|
{
|
|
|
|
return $this->web;
|
|
|
|
}
|
|
|
|
|
2021-09-07 09:52:14 +02:00
|
|
|
public function setWeb(string $web): void
|
2019-07-18 13:44:19 +02:00
|
|
|
{
|
|
|
|
$this->web = $web;
|
|
|
|
}
|
|
|
|
|
2021-09-07 09:52:14 +02:00
|
|
|
public function getTicket(): string
|
2019-07-18 13:44:19 +02:00
|
|
|
{
|
|
|
|
return $this->ticket;
|
|
|
|
}
|
|
|
|
|
2021-09-07 09:52:14 +02:00
|
|
|
public function setTicket(string $ticket): void
|
2019-07-18 13:44:19 +02:00
|
|
|
{
|
|
|
|
$this->ticket = $ticket;
|
|
|
|
}
|
|
|
|
|
2021-09-07 09:52:14 +02:00
|
|
|
public function getFacebook(): string
|
2019-07-18 13:44:19 +02:00
|
|
|
{
|
|
|
|
return $this->facebook;
|
|
|
|
}
|
|
|
|
|
2021-09-07 09:52:14 +02:00
|
|
|
public function setFacebook(string $facebook): void
|
2019-07-18 13:44:19 +02:00
|
|
|
{
|
|
|
|
$this->facebook = $facebook;
|
|
|
|
}
|
|
|
|
|
2021-09-07 09:52:14 +02:00
|
|
|
public function getYoutube(): string
|
2019-07-18 13:44:19 +02:00
|
|
|
{
|
|
|
|
return $this->youtube;
|
|
|
|
}
|
|
|
|
|
2021-09-07 09:52:14 +02:00
|
|
|
public function setYoutube(string $youtube): void
|
2019-07-18 13:44:19 +02:00
|
|
|
{
|
|
|
|
$this->youtube = $youtube;
|
|
|
|
}
|
|
|
|
|
2021-09-07 09:52:14 +02:00
|
|
|
public function getInstagram(): string
|
2020-08-19 11:30:13 +02:00
|
|
|
{
|
|
|
|
return $this->instagram;
|
|
|
|
}
|
|
|
|
|
2021-09-07 09:52:14 +02:00
|
|
|
public function setInstagram(string $instagram): void
|
2020-08-19 11:30:13 +02:00
|
|
|
{
|
|
|
|
$this->instagram = $instagram;
|
|
|
|
}
|
2021-01-07 08:50:43 +01:00
|
|
|
|
2019-07-18 13:44:19 +02:00
|
|
|
/**
|
2021-03-18 16:39:04 +01:00
|
|
|
* @return ObjectStorage<FileReference> $images
|
2019-07-18 13:44:19 +02:00
|
|
|
*/
|
2021-03-18 16:39:04 +01:00
|
|
|
public function getImages(): ObjectStorage
|
2019-07-18 13:44:19 +02:00
|
|
|
{
|
|
|
|
return $this->images;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2021-03-18 16:39:04 +01:00
|
|
|
* @param ObjectStorage<FileReference> $images
|
2019-07-18 13:44:19 +02:00
|
|
|
*/
|
2021-09-07 09:52:14 +02:00
|
|
|
public function setImages(ObjectStorage $images): void
|
2019-07-18 13:44:19 +02:00
|
|
|
{
|
|
|
|
$this->images = $images;
|
|
|
|
}
|
|
|
|
|
2021-09-07 09:52:14 +02:00
|
|
|
public function getSlug(): string
|
2019-07-18 13:44:19 +02:00
|
|
|
{
|
|
|
|
return $this->slug;
|
|
|
|
}
|
|
|
|
|
2021-09-07 09:52:14 +02:00
|
|
|
public function setSlug(string $slug): void
|
2019-07-18 13:44:19 +02:00
|
|
|
{
|
|
|
|
$this->slug = $slug;
|
|
|
|
}
|
|
|
|
|
2021-09-07 09:52:14 +02:00
|
|
|
public function addDate(Date $date): void
|
2019-07-18 13:44:19 +02:00
|
|
|
{
|
|
|
|
$this->dates->attach($date);
|
|
|
|
}
|
|
|
|
|
2021-09-07 09:52:14 +02:00
|
|
|
public function removeDate(Date $date): void
|
2019-07-18 13:44:19 +02:00
|
|
|
{
|
|
|
|
$this->dates->detach($date);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2021-09-07 09:52:14 +02:00
|
|
|
* @return ObjectStorage<Date>
|
2019-07-18 13:44:19 +02:00
|
|
|
*/
|
|
|
|
public function getDates(): ObjectStorage
|
|
|
|
{
|
|
|
|
return $this->dates;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2021-09-07 09:52:14 +02:00
|
|
|
* @param ObjectStorage<Date> $dates
|
2019-07-18 13:44:19 +02:00
|
|
|
*/
|
2021-09-07 09:52:14 +02:00
|
|
|
public function setDates(ObjectStorage $dates): void
|
2019-07-18 13:44:19 +02:00
|
|
|
{
|
|
|
|
$this->dates = $dates;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2021-09-07 09:52:14 +02:00
|
|
|
* @param ObjectStorage<Date> $dates
|
2019-07-18 13:44:19 +02:00
|
|
|
*/
|
2021-09-07 09:52:14 +02:00
|
|
|
public function removeAllDates(ObjectStorage $dates): void
|
2021-01-07 08:50:43 +01:00
|
|
|
{
|
2019-07-18 13:44:19 +02:00
|
|
|
$this->dates->removeAll($dates);
|
|
|
|
}
|
|
|
|
|
2021-01-11 10:15:21 +01:00
|
|
|
/**
|
|
|
|
* @return ObjectStorage<Partner>
|
|
|
|
*/
|
|
|
|
public function getPartner(): ObjectStorage
|
|
|
|
{
|
|
|
|
return $this->partner;
|
|
|
|
}
|
|
|
|
|
2021-07-13 09:31:01 +02:00
|
|
|
/**
|
|
|
|
* @return ObjectStorage<Event>
|
|
|
|
*/
|
|
|
|
public function getReferencesEvents(): ObjectStorage
|
|
|
|
{
|
|
|
|
return $this->referencesEvents;
|
|
|
|
}
|
|
|
|
|
2022-08-02 15:56:18 +02:00
|
|
|
public function setLocation(?Location $location): void
|
|
|
|
{
|
|
|
|
$this->location = $location;
|
|
|
|
|
|
|
|
// Keep this block as long as event still has the properties for legacy reasons.
|
|
|
|
// This ensures there is only a single point of truth, the new location object.
|
|
|
|
// That way we detect issues earlier and can migrate them until we get rid of the legacy code base.
|
|
|
|
if ($location instanceof Location) {
|
|
|
|
$this->name = '';
|
|
|
|
$this->street = '';
|
|
|
|
$this->district = '';
|
|
|
|
$this->city = '';
|
|
|
|
$this->zip = '';
|
|
|
|
$this->country = '';
|
|
|
|
$this->phone = '';
|
|
|
|
$this->latitude = '';
|
|
|
|
$this->longitude = '';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getLocation(): ?Location
|
|
|
|
{
|
|
|
|
return $this->location;
|
|
|
|
}
|
|
|
|
|
2021-09-07 09:52:14 +02:00
|
|
|
public function setOrganizer(Organizer $organizer): void
|
2019-07-18 13:44:19 +02:00
|
|
|
{
|
|
|
|
$this->organizer = $organizer;
|
|
|
|
}
|
|
|
|
|
2021-09-07 09:52:14 +02:00
|
|
|
public function getOrganizer(): ?Organizer
|
2019-07-18 13:44:19 +02:00
|
|
|
{
|
2021-09-07 09:52:14 +02:00
|
|
|
return $this->organizer;
|
2019-07-18 13:44:19 +02:00
|
|
|
}
|
|
|
|
|
2021-09-07 09:52:14 +02:00
|
|
|
public function getRegion(): ?Region
|
2019-07-18 13:44:19 +02:00
|
|
|
{
|
2021-09-07 09:52:14 +02:00
|
|
|
return $this->region;
|
2019-07-18 13:44:19 +02:00
|
|
|
}
|
|
|
|
|
2021-09-07 09:52:14 +02:00
|
|
|
public function setRegion(Region $region): void
|
2019-07-18 13:44:19 +02:00
|
|
|
{
|
2021-09-07 09:52:14 +02:00
|
|
|
$this->region = $region;
|
2019-07-18 13:44:19 +02:00
|
|
|
}
|
|
|
|
|
2021-09-07 09:52:14 +02:00
|
|
|
public function setHighlight(bool $highlight): void
|
2019-07-18 13:44:19 +02:00
|
|
|
{
|
|
|
|
$this->highlight = $highlight;
|
|
|
|
}
|
|
|
|
|
2021-09-07 09:52:14 +02:00
|
|
|
public function isHighlight(): bool
|
2019-07-18 13:44:19 +02:00
|
|
|
{
|
|
|
|
return $this->highlight;
|
|
|
|
}
|
|
|
|
|
2021-01-11 09:20:51 +01:00
|
|
|
public function getPages(): array
|
|
|
|
{
|
|
|
|
static $pages = null;
|
|
|
|
if (is_array($pages)) {
|
|
|
|
return $pages;
|
|
|
|
}
|
|
|
|
|
|
|
|
$pages = $this->dataProcessing->process($this);
|
|
|
|
|
|
|
|
return $pages;
|
|
|
|
}
|
|
|
|
|
2021-09-07 09:52:14 +02:00
|
|
|
public function addCategory(Category $category): void
|
2019-07-18 13:44:19 +02:00
|
|
|
{
|
|
|
|
$this->categories->attach($category);
|
|
|
|
}
|
|
|
|
|
2022-07-11 08:59:32 +02:00
|
|
|
/**
|
|
|
|
* @return array<Category>
|
|
|
|
*/
|
2021-03-23 16:34:38 +01:00
|
|
|
public function getCategories(): array
|
2019-07-18 13:44:19 +02:00
|
|
|
{
|
2021-03-23 16:34:38 +01:00
|
|
|
$categories = $this->categories->toArray();
|
|
|
|
|
|
|
|
usort($categories, function (Category $catA, Category $catB) {
|
|
|
|
return $catA->getSorting() <=> $catB->getSorting();
|
|
|
|
});
|
|
|
|
|
|
|
|
return $categories;
|
2019-07-18 13:44:19 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2021-09-07 09:52:14 +02:00
|
|
|
* @param ObjectStorage<Category> $categories
|
2019-07-18 13:44:19 +02:00
|
|
|
*/
|
2021-09-07 09:52:14 +02:00
|
|
|
public function setCategories(ObjectStorage $categories): void
|
2019-07-18 13:44:19 +02:00
|
|
|
{
|
|
|
|
$this->categories = $categories;
|
|
|
|
}
|
2020-10-01 08:34:13 +02:00
|
|
|
|
2022-07-11 08:59:32 +02:00
|
|
|
/**
|
|
|
|
* @return array<Category>
|
|
|
|
*/
|
2022-07-05 14:08:14 +02:00
|
|
|
public function getFeatures(): array
|
|
|
|
{
|
|
|
|
$features = $this->features->toArray();
|
|
|
|
|
|
|
|
usort($features, function (Category $catA, Category $catB) {
|
|
|
|
return $catA->getSorting() <=> $catB->getSorting();
|
|
|
|
});
|
|
|
|
|
|
|
|
return $features;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param ObjectStorage<Category> $features
|
|
|
|
*/
|
|
|
|
public function setFeatures(ObjectStorage $features): void
|
|
|
|
{
|
|
|
|
$this->features = $features;
|
|
|
|
}
|
|
|
|
|
2021-09-07 09:52:14 +02:00
|
|
|
public function setLanguageUid(int $languageUid): void
|
2021-01-07 08:50:43 +01:00
|
|
|
{
|
2020-10-01 08:56:44 +02:00
|
|
|
$this->_languageUid = $languageUid;
|
2020-10-01 08:34:13 +02:00
|
|
|
}
|
|
|
|
|
2021-09-07 09:52:14 +02:00
|
|
|
public function getLanguageUid(): int
|
2021-01-07 08:50:43 +01:00
|
|
|
{
|
2020-10-01 08:56:44 +02:00
|
|
|
return $this->_languageUid;
|
2020-10-01 08:34:13 +02:00
|
|
|
}
|
2021-03-16 08:10:46 +01:00
|
|
|
|
2021-09-07 09:52:14 +02:00
|
|
|
public function getLocalizedUid(): int
|
2021-03-16 08:10:46 +01:00
|
|
|
{
|
|
|
|
return $this->_localizedUid;
|
|
|
|
}
|
2022-08-02 15:56:18 +02:00
|
|
|
|
|
|
|
// Legacy location related info
|
|
|
|
|
|
|
|
public function getName(): string
|
|
|
|
{
|
|
|
|
if ($this->location instanceof Location) {
|
|
|
|
return $this->location->getName();
|
|
|
|
}
|
|
|
|
|
|
|
|
return $this->name;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getStreet(): string
|
|
|
|
{
|
|
|
|
if ($this->location instanceof Location) {
|
|
|
|
return $this->location->getStreet();
|
|
|
|
}
|
|
|
|
|
|
|
|
return $this->street;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getDistrict(): string
|
|
|
|
{
|
|
|
|
if ($this->location instanceof Location) {
|
|
|
|
return $this->location->getDistrict();
|
|
|
|
}
|
|
|
|
|
|
|
|
return $this->district;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getCountry(): string
|
|
|
|
{
|
|
|
|
if ($this->location instanceof Location) {
|
|
|
|
return $this->location->getCountry();
|
|
|
|
}
|
|
|
|
|
|
|
|
return $this->country;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getCity(): string
|
|
|
|
{
|
|
|
|
if ($this->location instanceof Location) {
|
|
|
|
return $this->location->getCity();
|
|
|
|
}
|
|
|
|
|
|
|
|
return $this->city;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getZip(): string
|
|
|
|
{
|
|
|
|
if ($this->location instanceof Location) {
|
|
|
|
return $this->location->getZip();
|
|
|
|
}
|
|
|
|
|
|
|
|
return $this->zip;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getPhone(): string
|
|
|
|
{
|
|
|
|
if ($this->location instanceof Location) {
|
|
|
|
return $this->location->getPhone();
|
|
|
|
}
|
|
|
|
|
|
|
|
return $this->phone;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getLatitude(): string
|
|
|
|
{
|
|
|
|
if ($this->location instanceof Location) {
|
|
|
|
return $this->location->getLatitude();
|
|
|
|
}
|
|
|
|
|
|
|
|
return $this->latitude;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getLongitude(): string
|
|
|
|
{
|
|
|
|
if ($this->location instanceof Location) {
|
|
|
|
return $this->location->getLongitude();
|
|
|
|
}
|
|
|
|
|
|
|
|
return $this->longitude;
|
|
|
|
}
|
2019-07-18 13:44:19 +02:00
|
|
|
}
|