<?php
namespace App\Entity;
use App\Business\Context;
use App\Business\ContextableEntity;
use App\Business\EventCategoryProvider;
use App\Business\LocalizableEntity;
use App\Application\Sonata\MediaBundle\Entity\Gallery;
use App\Application\Sonata\MediaBundle\Entity\Media;
use Behat\Transliterator\Transliterator;
use DateTime;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\SoftDeleteable\Traits\SoftDeleteableEntity;
use Symfony\Component\Validator\Constraints as Assert;
use JMS\Serializer\Annotation as Serializer;
/**
* Event
*
* @ORM\Table(name="event")
* @ORM\Entity(repositoryClass="App\Repository\EventRepository")
*/
class Event extends LocalizableEntity implements ContextableEntity
{
use \Gedmo\Timestampable\Traits\TimestampableEntity;
use BlameableEntity;
use SoftDeleteableEntity;
const PROP_EVENT = 'event';
const PROP_EVENT_NO = 'eventNo';
const EVENT_NO_CATEGORY = "no-category";
const EVENT_WORLDFEED_CATEGORY = "worldfeed";
const EVENT_WORLDLINK_CATEGORY = "worldlink";
/** Open Booking Status */
const OPEN_BOOKING_DISABLED = false;
const OPEN_BOOKING_ENABLED = true;
public $currentUserIsFollower = false;
/**
* @var int
*
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
* @Serializer\Groups({"list"})
*/
private $id;
/**
* FROM NEOS
*
* @var string
* @ORM\Column(name="event_no", type="string", length=255)
* @Serializer\Groups({"list"})
*/
private $eventNo;
/**
* FROM NEOS
*
* @var string
* @ORM\Column(name="category", type="string", length=255, nullable=true)
* @Serializer\Groups({"list"})
*/
private $category;
/**
* FROM NEOS
*
* @var string
* @ORM\Column(name="category_code", type="string", length=255, nullable=true)
* @Serializer\Groups({"list"})
*/
private $categoryCode;
/**
* FROM NEOS
*
* @var string
* @ORM\Column(name="sub_category", type="string", length=255, nullable=true)
* @Serializer\Groups({"list"})
*/
private $subCategory;
/**
* FROM NEOS
*
* @var string
* @ORM\Column(name="sub_category_code", type="string", length=255, nullable=true)
* @Serializer\Groups({"list"})
*/
private $subCategoryCode;
/**
* FROM NEOS
*
* @var string
* @ORM\Column(name="venue", type="string", length=255, nullable=true)
* @Serializer\Groups({"list"})
*/
private $venue;
/**
* FROM NEOS
*
* @var string
* @ORM\Column(name="title", type="string", length=255)
* @Serializer\Groups({"list"})
*/
private $title;
/**
* @var string
* @Assert\Length(max=500)
* @ORM\Column(name="description", type="text", nullable=true)
* @Serializer\Groups({"list"})
*/
private $description;
/**
* @var string
* @ORM\Column(name="long_description", type="text", nullable=true)
* @Serializer\Groups({"list"})
*/
private $longDescription;
/**
* FROM NEOS
*
* @var string
* @ORM\Column(name="language_graphics", type="text", nullable=true)
*/
private $languageOfGraphics;
/**
* FROM NEOS
*
* @var string
* @ORM\Column(name="signal_description", type="text", nullable=true)
*/
private $signalDescription;
/**
* @var string
* @ORM\Column(name="additional_infos", type="text", nullable=true)
*/
private $additionalInfos;
/**
* @var string
* @ORM\Column(name="others", type="text", nullable=true)
*/
private $others;
/**
* FROM NEOS
* @ORM\Column(name="start_date", type="date")
* @Serializer\Groups({"list"})
*/
private $startDate;
/**
* FROM NEOS
* @ORM\Column(name="deadline_date", type="date",nullable=true)
* @Serializer\Groups({"list"})
*/
private $deadlineDate;
/**
* set
* FROM NEOS
* @ORM\Column(name="facilities_deadline_date", type="date",nullable=true)
*/
private $facilitiesDeadlineDate;
/**
* FROM NEOS
* @ORM\Column(name="end_date", type="date")
* @Serializer\Groups({"list"})
*/
private $endDate;
/**
* FROM NEOS
* @ORM\Column(name="status", type="string", length=50)
* @Serializer\Groups({"list"})
*/
private $status;
/**
* FROM NEOS. Data updated in the synchronization process.
* @ORM\Column(name="visible_backend", type="boolean", nullable=true, options={"default" : false})
*/
private $visibleBackend;
/**
* FROM NEOS
* @ORM\Column(name="visible_frontend", type="boolean", nullable=true, options={"default" : false})
*/
private $visibleFrontend;
/**
* FROM NEOS
* @ORM\Column(name="event_type", type="string", length=10)
* @Serializer\Groups({"list"})
*/
private $eventType;
/**
* FROM NEOS
* @ORM\Column(name="responsible_office", type="string", length=100, nullable=true)
*/
private $responsibleOffice;
/**
* FROM NEOS
* @ORM\Column(name="responsible_code", type="string", length=100, nullable=true)
*/
private $responsibleCode;
/**
* FROM NEOS
* @ORM\Column(name="responsible_details", type="text", nullable=true)
*/
private $responsibleDetails;
/**
* FROM NEOS
* @ORM\Column(name="contact_on_site", type="string", length=100, nullable=true)
*/
private $contactOnSite;
/**
* FROM NEOS
* @ORM\Column(name="contact_on_site_details", type="text", nullable=true)
*/
private $contactOnSiteDetails;
/**
* FROM NEOS
* @ORM\Column(name="is_partial_timing_allowed", type="boolean", nullable=true)
*/
private $isPartialTimingAllowed;
/**
* FROM NEOS
* @ORM\Column(name="is_uni_order_allowed", type="boolean", nullable=true)
*/
private $isUniOrderAllowed;
/**
* FROM NEOS
* @ORM\Column(name="rhs_booking_allowed", type="boolean", nullable=true)
*/
private $rhsBookingAllowed = false;
/**
* @var boolean
* @ORM\Column(name="show_unis_in_transmissions", type="boolean", nullable = true)
*/
private $showUnisInTransmissions = true;
/**
* @var boolean
* @ORM\Column(name="neos_valid_configuration", type="boolean", nullable = true)
*/
private $neosValidConfiguration = true;
/**
* @var text
* @ORM\Column(name="neos_configuration_note", type="text", nullable=true)
*/
private $neosConfigurationNote;
/**
* @var boolean
* @ORM\Column(name="show_booking_contact", type="boolean", nullable = true)
*/
private $showBookingContact = true;
/**
* @var boolean
* @ORM\Column(name="show_past_transmissions", type="boolean", nullable = true)
*/
private $showPastTransmissions = true;
/**
* @var boolean
* @ORM\Column(name="show_news_operation_contact", type="boolean", nullable = true)
*/
private $showNewsOperationContact = false;
/**
* FROM NEOS
* To be used to activate or not the rhs bookin
* @ORM\Column(name="priority", type="integer", nullable=true)
*/
private $priority;
/**
* @ORM\Column(name="city_code", type="string", length=100, nullable=true)
* @Serializer\Groups({"list"})
*/
private $cityCode;
/**
* @ORM\Column(name="city_name", type="string", length=255, nullable=true)
* @Serializer\Groups({"list"})
*/
private $cityName;
/**
* @ORM\Column(name="country_city_code", type="string", length=256, nullable=true)
* @Serializer\Groups({"list"})
*/
private $countryCityCode;
/**
* @ORM\Column(name="country_code", type="string", length=100, nullable=true)
* @Serializer\Groups({"list"})
*/
private $countryCode;
/**
* @ORM\Column(name="country_name", type="string", length=255, nullable=true)
* @Serializer\Groups({"list"})
*/
private $countryName;
/**
* Used for RHS to map event to an application
*
* @var string
* @ORM\Column(name="entra_app_id", type="string", length=255, nullable=true)
*/
private $entraAppId;
/**
* @ORM\OneToMany(targetEntity="App\Entity\Image", mappedBy="event")
*/
private $images;
/**
* @return mixed
*/
public function getImages()
{
return $this->images;
}
/**
* @param mixed $images
*/
public function setImages($images)
{
$this->images = $images;
}
/**
* Add image
*
* @param Image $image
*
* @return Event
*/
public function addImage(Image $image)
{
$image->setEvent($this);
$this->images[] = $image;
return $this;
}
/**
* Remove image
*
* @param Image $image
*/
public function removeImage(Image $image)
{
$this->images->removeImage($image);
}
/**
* @ORM\OneToMany(targetEntity="App\Entity\Document", mappedBy="event")
*/
private $documents;
/**
* For RHS, contains entra id
*
* @var string
* @ORM\Column(name="entra_role_id_admin", type="string", length=255, nullable=true)
*/
private $entraRoleIdAdmin;
/**
* For RHS, contains entra id
*
* @var string
* @ORM\Column(name="entra_role_id_super_user", type="string", length=255, nullable=true)
*/
private $entraRoleIdSuperUser;
/**
* For RHS, contains entra id
*
* @var string
* @ORM\Column(name="entra_role_id_user", type="string", length=255, nullable=true)
*/
private $entraRoleIdUser;
/**
* For RHS, contains entra id
*
* @var string
* @ORM\Column(name="entra_role_id_reader", type="string", length=255, nullable=true)
*/
private $entraRoleIdReader;
/**
* EDITABLE IN ENET
* @ORM\ManyToOne(targetEntity="App\Application\Sonata\MediaBundle\Entity\Media", cascade={"persist"}, fetch="LAZY")
* @ORM\JoinColumns({
* @ORM\JoinColumn(name="banner_id", referencedColumnName="id")})
*/
private $banner;
/**
* EDITABLE IN ENET
* Banner for RHS
* @ORM\ManyToOne(targetEntity="App\Application\Sonata\MediaBundle\Entity\Media", cascade={"persist"}, fetch="LAZY")
* @ORM\JoinColumns({
* @ORM\JoinColumn(name="rhs_banner_id", referencedColumnName="id")})
*/
private $rhsBanner;
/**
* EDITABLE IN ENET
*
* @var string
* @ORM\Column(name="photo_credit",type="string", length=255, nullable=true)
*/
private $photoCredit;
/**
* EDITABLE IN ENET
* @ORM\ManyToOne(targetEntity="App\Application\Sonata\MediaBundle\Entity\Media", cascade={"persist"}, fetch="LAZY")
* @ORM\JoinColumns({
* @ORM\JoinColumn(name="image_id", referencedColumnName="id")})
*
*/
private $image;
/**
* FROM NEOS
*
* @var ArrayCollection
* @ORM\OneToMany(targetEntity="App\Entity\Node", mappedBy="event", cascade={"all"})
* @ORM\OrderBy({"title" = "ASC"})
*/
private $nodes;
/**
* FROM NEOS
*
* @var ArrayCollection
* @ORM\OneToMany(targetEntity="App\Entity\WorldFeed", mappedBy="event", cascade={"all"})
* @ORM\OrderBy({"startDate" = "ASC"})
*/
private $worldFeeds;
/**
* EDITABLE IN ENET
*
* @var ArrayCollection
* @ORM\OneToMany(targetEntity="App\Entity\EventArticle", mappedBy="event", cascade={"all"})
* @ORM\OrderBy({"updatedAt" = "DESC"})
*/
private $articles;
/**
* EDITABLE IN ENET
*
* @var ArrayCollection
* @ORM\OneToMany(targetEntity="App\Entity\QuickLink", mappedBy="event", cascade={"persist","remove"})
*/
private $quickLinks;
/**
* FROM NEOS. Updating in the synchronization process.
* @ORM\Column(name="contains_worldfeed", type="boolean", nullable=true, options={"default" : false})
*/
private $containsWorldFeed = false;
/**
* FROM NEOS. Updating in the synchronization process.
* @ORM\Column(name="contains_worldlink", type="boolean", nullable=true, options={"default" : false})
*/
private $containsWorldLink = false;
/**
* FROM NEOS. Updating in the synchronization process.
* @ORM\Column(name="media", type="string", length=50, nullable=true)
*/
private $media;
/**
* FROM NEOS. Updating in the synchronization process.
* @ORM\Column(name="booking_enabled", type="boolean", nullable=true, options={"default" : false})
*/
private $bookingEnabled = Event::OPEN_BOOKING_DISABLED;
/**
* EDITABLE IN ENET
*
* @var string
* @ORM\Column(name="rate_card", type="text", nullable=true)
*/
private $rateCard;
/**
* EDITABLE IN ENET
*
* @var string
* @ORM\Column(name="cancellation_policy", type="text", nullable=true)
*/
private $cancellationPolicy;
/**
* EDITABLE IN ENET
* @ORM\ManyToOne(targetEntity="App\Application\Sonata\MediaBundle\Entity\Gallery", cascade={"persist"}, fetch="LAZY")
*/
private $gallery;
/**
* FROM NEOS
* @ORM\Column(name="website", type="string", length=255, nullable=true)
*/
private $website;
/**
* @var EventGroupContactsHost $eventGroupContactsHost
* @ORM\OneToOne(targetEntity="EventGroupContactsHost", cascade={"persist"})
*/
private $eventGroupContactsHost;
/**
* FROM NEOS
*
* @var EventGroupContactsAccreditation $eventGroupContactsAccreditation
* @ORM\OneToOne(targetEntity="EventGroupContactsAccreditation", cascade={"persist"})
*/
private $eventGroupContactsAccreditation;
/**
* FROM NEOS
*
* @var EventGroupContactsOnSite $eventGroupContactsOnSite
* @ORM\OneToOne(targetEntity="EventGroupContactsOnSite", cascade={"persist"})
*/
private $eventGroupContactsOnSite;
/**
* FROM NEOS
*
* @var EventGroupContactsRights $eventGroupContactsRights
* @ORM\OneToOne(targetEntity="EventGroupContactsRights", cascade={"persist"})
*/
private $eventGroupContactsRights;
/**
* FROM NEOS
*
* @var EventGroupContactsOthers $eventGroupContactsOthers
* @ORM\OneToOne(targetEntity="EventGroupContactsOthers", cascade={"persist"})
*/
private $eventGroupContactsOthers;
/**
* Editable in ENET
*
* @var EventOpsProd $eventOpsProd
* @ORM\OneToOne(targetEntity="App\Entity\EventOpsProd", cascade={"persist"}, inversedBy="event")
*/
private $eventOpsProd;
/**
* EDITABLE IN ENET
*
* @var string
* @ORM\Column(name="rate_card_member", type="text", nullable=true)
*/
private $rateCardMember;
/**
* @var string
* @ORM\Column(name="worldfeed_description", type="text", nullable=true)
*/
private $worldfeedDescription;
/**
* @ORM\ManyToMany(targetEntity="App\Entity\Event")
* @ORM\JoinTable(name="related_events",
* joinColumns={@ORM\JoinColumn(name="event_id", referencedColumnName="id")},
* inverseJoinColumns={@ORM\JoinColumn(name="relatedEvent_id", referencedColumnName="id")}
* )
*/
private $relatedEvents;
/**
* Constructor
*/
public function __construct()
{
$this->documents = new ArrayCollection();
$this->images = new ArrayCollection();
$this->articles = new ArrayCollection();
$this->quickLinks = new ArrayCollection();
$this->worldFeeds = new ArrayCollection();
$this->eventGroupContactsAccreditation = new EventGroupContactsAccreditation();
$this->eventGroupContactsRights = new EventGroupContactsRights();
$this->eventGroupContactsOthers = new EventGroupContactsOthers();
$this->eventGroupContactsHost = new EventGroupContactsHost();
$this->eventGroupContactsOnSite = new EventGroupContactsOnSite();
$this->eventOpsProd = new EventOpsProd();
$this->eventOpsProd->setEvent($this);
$this->relatedEvents = new ArrayCollection();
}
/**
* @return mixed
*/
public function getFacilitiesDeadlineDate()
{
return $this->facilitiesDeadlineDate;
}
/**
* @param mixed $facilitiesDeadlineDate
*/
public function setFacilitiesDeadlineDate($facilitiesDeadlineDate): void
{
$this->facilitiesDeadlineDate = $facilitiesDeadlineDate;
}
/**
* @return mixed
*/
public function getVisibleBackend()
{
return $this->visibleBackend;
}
/**
* @param mixed $visibleBackend
*/
public function setVisibleBackend($visibleBackend): void
{
$this->visibleBackend = $visibleBackend;
}
/**
* @return mixed
*/
public function getContainsWorldFeed()
{
return $this->containsWorldFeed;
}
/**
* @param mixed $containsWorldFeed
*/
public function setContainsWorldFeed($containsWorldFeed): void
{
$this->containsWorldFeed = $containsWorldFeed;
}
/**
* @return mixed
*/
public function getContainsWorldLink()
{
return $this->containsWorldLink;
}
/**
* @param mixed $containsWorldLink
*/
public function setContainsWorldLink($containsWorldLink): void
{
$this->containsWorldLink = $containsWorldLink;
}
/**
* @return mixed
*/
public function getMedia()
{
return $this->media;
}
/**
* @param mixed $media
*/
public function setMedia($media): void
{
$this->media = $media;
}
public function setEventNotVisibleAtAll()
{
$this->setBookingEnabled(false);
$this->setVisibleFrontend(false);
$this->setVisibleBackend(false);
}
/**
* @return mixed
*/
public function getVisibleFrontend()
{
return $this->visibleFrontend;
}
/**
* @param mixed $visibleFrontend
*/
public function setVisibleFrontend($visibleFrontend): void
{
$this->visibleFrontend = $visibleFrontend;
}
/**
* @return EventGroupContactsOnSite
*/
public function getEventGroupContactsOnSite(): EventGroupContactsOnSite
{
if ($this->eventGroupContactsOnSite == null) {
$this->eventGroupContactsOnSite = new EventGroupContactsOnSite();
}
return $this->eventGroupContactsOnSite;
}
/**
* @param EventGroupContactsOnSite $eventGroupContactsOnSite
*/
public function setEventGroupContactsOnSite(EventGroupContactsOnSite $eventGroupContactsOnSite): void
{
$this->eventGroupContactsOnSite = $eventGroupContactsOnSite;
}
/**
* @return string
*/
public function getOthers(): ?string
{
return $this->others;
}
/**
* @param string $others
*/
public function setOthers(string $others): void
{
$this->others = $others;
}
/**
* @return EventOpsProd
*/
public function getEventOpsProd(): ?EventOpsProd
{
return $this->eventOpsProd;
}
/**
* @param EventOpsProd $eventOpsProd
*/
public function setEventOpsProd(EventOpsProd $eventOpsProd): void
{
$eventOpsProd->setEvent($this);
$this->eventOpsProd = $eventOpsProd;
}
/**
* @return string
*/
public function getLanguageOfGraphics(): ?string
{
return $this->languageOfGraphics;
}
/**
* @param string $languageOfGraphics
*/
public function setLanguageOfGraphics(string $languageOfGraphics = null): void
{
$this->languageOfGraphics = $languageOfGraphics;
}
/**
* @return string
*/
public function getSignalDescription(): ?string
{
return $this->signalDescription;
}
/**
* @param string $signalDescription
*/
public function setSignalDescription(string $signalDescription = null): void
{
$this->signalDescription = $signalDescription;
}
/**
* @return string
*/
public function getAdditionalInfos(): ?string
{
return $this->additionalInfos;
}
/**
* @param string $additionalInfos
*/
public function setAdditionalInfos(string $additionalInfos = null): void
{
$this->additionalInfos = $additionalInfos;
}
/**
* @return string
*/
public function getCancellationPolicy(): ?string
{
return $this->cancellationPolicy;
}
/**
* @param string $cancellationPolicy
*/
public function setCancellationPolicy(string $cancellationPolicy = null): void
{
$this->cancellationPolicy = $cancellationPolicy;
}
/**
* @return string
*/
public function getStatus()
{
return $this->status;
}
/**
* Set status
*
* @param string $status
*
* @return Event
*/
public function setStatus($status)
{
$this->status = $status;
return $this;
}
public function updateCountryCityCode()
{
$this->countryCityCode = Location::buildCountryCityCode($this->getCountryCode(), $this->getCityCode());
}
/**
* @return mixed
*/
public function getCountryCode()
{
return $this->countryCode;
}
/**
* Set countryCode
*
* @param string $countryCode
*
* @return Event
*/
public function setCountryCode($countryCode)
{
$this->countryCode = $countryCode;
return $this;
}
/**
* @return mixed
*/
public function getCityCode()
{
return $this->cityCode;
}
/**
* Set cityCode
*
* @param string $cityCode
*
* @return Event
*/
public function setCityCode($cityCode)
{
$this->cityCode = $cityCode;
return $this;
}
/**
* @return EventGroupContactsAccreditation
*/
public function getEventGroupContactsAccreditation(): ?EventGroupContactsAccreditation
{
return $this->eventGroupContactsAccreditation;
}
/**
* @param EventGroupContactsAccreditation $eventGroupContactsAccreditation
*/
public function setEventGroupContactsAccreditation(EventGroupContactsAccreditation $eventGroupContactsAccreditation = null): void
{
$this->eventGroupContactsAccreditation = $eventGroupContactsAccreditation;
}
/**
* @return EventGroupContactsRights
*/
public function getEventGroupContactsRights(): ?EventGroupContactsRights
{
return $this->eventGroupContactsRights;
}
/**
* @param EventGroupContactsRights $eventGroupContactsRights
*/
public function setEventGroupContactsRights(EventGroupContactsRights $eventGroupContactsRights = null): void
{
$this->eventGroupContactsRights = $eventGroupContactsRights;
}
/**
* @return EventGroupContactsOthers
*/
public function getEventGroupContactsOthers(): ?EventGroupContactsOthers
{
return $this->eventGroupContactsOthers;
}
/**
* @param EventGroupContactsOthers $eventGroupContactsOthers
*/
public function setEventGroupContactsOthers(EventGroupContactsOthers $eventGroupContactsOthers = null): void
{
$this->eventGroupContactsOthers = $eventGroupContactsOthers;
}
/**
* @return EventGroupContactsHost
*/
public function getEventGroupContactsHost(): ?EventGroupContactsHost
{
return $this->eventGroupContactsHost;
}
/**
* @param EventGroupContactsHost $eventGroupContactsHost
*/
public function setEventGroupContactsHost(EventGroupContactsHost $eventGroupContactsHost = null): void
{
$this->eventGroupContactsHost = $eventGroupContactsHost;
}
/**
* @return bool true is the event is bookable
*/
public function isBookable(): bool
{
return ($this->getBookingEnabled());
}
/**
* @return boolean
*/
public function getBookingEnabled(): bool
{
return $this->bookingEnabled != null && $this->bookingEnabled;
}
/**
* @param boolean $bookingEnabled
*
* @return Event
*/
public function setBookingEnabled($bookingEnabled)
{
$this->bookingEnabled = $bookingEnabled;
return $this;
}
public function getActiveNodes()
{
$res = [];
$nodes = $this->getNodes();
if (!empty($nodes)) {
/**
* @var Node $node
*/
foreach ($nodes as $node) {
if (EntityInterface::STATUS_ACTIVE == $node->getStatus()) {
$res[] = $node;
}
}
}
return $res;
}
/**
* Get all nodes even nodes that are inactive
*
* @return Collection
*/
public function getNodes()
{
return $this->nodes;
}
public function getActiveWorldFeeds(?bool $includePastItems = true, ?array $worldfeedTransmissionToBeDisplayedInFlyer = null)
{
$res = [];
$worldFeeds = $this->getWorldFeeds();
if (!empty($worldFeeds)) {
/**
* @var WorldFeed $worldFeed
*/
foreach ($worldFeeds as $worldFeed) {
if ($includePastItems) {
if (EntityInterface::STATUS_ACTIVE == $worldFeed->status) {
if (empty($worldfeedTransmissionToBeDisplayedInFlyer) || (!empty($worldfeedTransmissionToBeDisplayedInFlyer) && in_array($worldFeed->transmissionNo, $worldfeedTransmissionToBeDisplayedInFlyer))) {
$res[] = $worldFeed;
}
}
} else {
if (EntityInterface::STATUS_ACTIVE == $worldFeed->status && $worldFeed->endDate > new DateTime('today')) {
if (empty($worldfeedTransmissionToBeDisplayedInFlyer) || (!empty($worldfeedTransmissionToBeDisplayedInFlyer) && in_array($worldFeed->transmissionNo, $worldfeedTransmissionToBeDisplayedInFlyer))) {
$res[] = $worldFeed;
}
}
}
}
}
return $res;
}
/**
* @return Collection
*/
public function getWorldFeeds(): Collection
{
return $this->worldFeeds;
}
/**
* @return string
*/
public function getEntraRoleIdReader(): ?string
{
return $this->entraRoleIdReader;
}
/**
* @param string $entraRoleIdReader
*/
public function setEntraRoleIdReader(string $entraRoleIdReader = null): void
{
$this->entraRoleIdReader = $entraRoleIdReader;
}
/**
* @return string
*/
public function getPhotoCredit(): ?string
{
return $this->photoCredit;
}
/**
* @param string $photoCredit
*/
public function setPhotoCredit(string $photoCredit = null): void
{
$this->photoCredit = $photoCredit;
}
/**
* @return string Context::EVENTS
*/
public function getContextId(): string
{
return Context::EVENTS;
}
/**
* For unit test
*
* @param string $eventNo
* @param string $eventTitle
* @param string $status
* @param string $type
*/
public function init(string $eventNo, string $eventTitle = null, string $status = null, string $type = null)
{
$this->eventNo = $eventNo;
$this->title = $eventTitle;
$this->status = $status;
$this->eventType = $type;
}
/**
* For unit test
*
* @param DateTime $startDate
* @param DateTime $entDate
*/
public function initDate(DateTime $startDate, DateTime $entDate)
{
$this->startDate = $startDate;
$this->endDate = $entDate;
}
/**
* @return string
*/
public function getVenue(): ?string
{
return $this->venue;
}
/**
* Set venue
*
* @param string $venue
*
* @return Event
*/
public function setVenue($venue)
{
$this->venue = $venue;
return $this;
}
/**
* @return DateTime
*/
public function getDeadlineDate()
{
return $this->deadlineDate;
}
/**
* Set deadlineDate
*
* @param DateTime $deadlineDate
*
* @return Event
*/
public function setDeadlineDate($deadlineDate)
{
$this->deadlineDate = $deadlineDate;
return $this;
}
/**
* @return mixed
*/
public function getPriority()
{
return $this->priority;
}
/**
* @param mixed $priority
*/
public function setPriority($priority)
{
$this->priority = $priority;
}
/**
* @return string
*/
public function getCategoryCode(): ?string
{
return $this->categoryCode;
}
/**
* Set categoryCode
*
* @param string $categoryCode
*
* @return Event
*/
public function setCategoryCode($categoryCode)
{
$this->categoryCode = $categoryCode;
return $this;
}
/**
* @return string
*/
public function getSubCategoryCode(): ?string
{
return $this->subCategoryCode;
}
/**
* Set subCategoryCode
*
* @param string $subCategoryCode
*
* @return Event
*/
public function setSubCategoryCode($subCategoryCode)
{
$this->subCategoryCode = $subCategoryCode;
return $this;
}
/**
* @return string
*/
public function getCategory(): ?string
{
return $this->category;
}
/**
* @param string $category
*/
public function setCategory(string $category = null)
{
$this->category = $category;
}
/**
* @return string
*/
public function getCategoryDisplay(): ?string
{
return $this->category;
}
/**
* @return string
*/
public function getSubCategory(): ?string
{
return $this->subCategory;
}
/**
* Set subCategory
*
* @param string $subCategory
*
* @return Event
*/
public function setSubCategory($subCategory)
{
$this->subCategory = $subCategory;
return $this;
}
public function toString(): string
{
return "{id=" . $this->id . "}";
}
/**
* @return string
*/
public function getEntraRoleIdAdmin()
{
return $this->entraRoleIdAdmin;
}
/**
* @param string $entraRoleIdAdmin
*/
public function setEntraRoleIdAdmin(string $entraRoleIdAdmin)
{
$this->entraRoleIdAdmin = $entraRoleIdAdmin;
}
/**
* @return string
*/
public function getEntraRoleIdSuperUser()
{
return $this->entraRoleIdSuperUser;
}
/**
* @param string $entraRoleIdSuperUser
*/
public function setEntraRoleIdSuperUser(string $entraRoleIdSuperUser)
{
$this->entraRoleIdSuperUser = $entraRoleIdSuperUser;
}
/**
* @return string
*/
public function getEntraRoleIdUser()
{
return $this->entraRoleIdUser;
}
/**
* @param string $entraRoleIdUser
*/
public function setEntraRoleIdUser(string $entraRoleIdUser)
{
$this->entraRoleIdUser = $entraRoleIdUser;
}
/**
* FROM NEOS
*
* @return string
*/
public function getEventNo()
{
return $this->eventNo;
}
/**
* FROM NEOS
* Set eventNo
*
* @param string $eventNo
*
* @return Event
*/
public function setEventNo($eventNo)
{
$this->eventNo = $eventNo;
return $this;
}
/**
* @return string
*/
public function getTitle()
{
return $this->title;
}
/**
* Set title
*
* @param string $title
*
* @return Event
*/
public function setTitle($title)
{
$this->title = $title;
return $this;
}
/**
* Get entraAppId
*
* @return string
*/
public function getEntraAppId()
{
return $this->entraAppId;
}
/**
* Set entraAppId
*
* @param string $entraAppId
*
* @return Event
*/
public function setEntraAppId($entraAppId)
{
$this->entraAppId = $entraAppId;
return $this;
}
/**
* Add document
*
* @param Document $document
*
* @return Event
*/
public function addDocument(Document $document)
{
$document->setEvent($this);
$this->documents[] = $document;
return $this;
}
/**
* Remove document
*
* @param Document $document
*/
public function removeDocument(Document $document)
{
$this->documents->removeElement($document);
}
/**
* Get documents
*
* @return Collection
*/
public function getDocuments()
{
return $this->documents;
}
public function uploadImage()
{
}
/**
* Get banner
*
* @return Media
*/
public function getBanner()
{
return $this->banner;
}
/**
* Set banner
*
* @param Media $banner
*
* @return Event
*/
public function setBanner(Media $banner = null)
{
$this->banner = $banner;
return $this;
}
/**
* Get rhsBanner
*
* @return Media
*/
public function getRhsBanner()
{
return $this->rhsBanner;
}
/**
* Set rhsBanner
*
* @param Media $rhsBanner
*
* @return Event
*/
public function setRhsBanner(Media $rhsBanner = null)
{
$this->rhsBanner = $rhsBanner;
return $this;
}
/**
* Get image
*
* @return Media
*/
public function getImage()
{
return $this->image;
}
/**
* Set image
*
* @param Media $image
*
* @return Event
*/
public function setImage(Media $image = null)
{
$this->image = $image;
return $this;
}
/**
* Get startDate
*
* @return DateTime
*/
public function getStartDate()
{
return $this->startDate;
}
/**
* Set startDate
*
* @param DateTime $startDate
*
* @return Event
*/
public function setStartDate($startDate)
{
$this->startDate = $startDate;
return $this;
}
/**
* @return DateTime
*/
public function getEndDate()
{
return $this->endDate;
}
/**
* Set endDate
*
* @param DateTime $endDate
*
* @return Event
*/
public function setEndDate($endDate)
{
$this->endDate = $endDate;
return $this;
}
public function getPathDetails()
{
return 'events_details';
}
public function getEventCategory()
{
return $this->getContextMainCategoryId();
}
public function getContextMainCategoryId(): string
{
return EventCategoryProvider::getMainCategory($this);
}
public function getFlyerContextMainCategoryId(): string
{
return EventCategoryProvider::getFlyerMainCategory($this);
}
public function getMainCategoryPath()
{
return "events_" . $this->getContextMainCategoryId();
}
public function getMainCategoryTitle()
{
return EventCategoryProvider::getMainCategoryTitle($this);
}
public function getMainCategoryNews()
{
return "events_" . $this->getContextMainCategoryId();
}
public function getContextCategoryId(): string
{
return $this->getCategoryUrl();
}
/**
* @return string
*/
public function getCategoryUrl(): ?string
{
if ($this->category == null || $this->category == '') {
return Event::EVENT_NO_CATEGORY;
}
return Transliterator::transliterate(strtolower($this->category));
}
public function isSport()
{
return EventCategoryProvider::CAT_SPORTS == $this->getContextMainCategoryId();
}
public function isNews()
{
return EventCategoryProvider::CAT_NEWS == $this->getContextMainCategoryId();
}
public function isCulture()
{
return EventCategoryProvider::CAT_CULTURE == $this->getContextMainCategoryId();
}
public function isSportEvent()
{
return $this->getEventType() == EventCategoryProvider::NEOS_TYPE_PROG;
}
/**
* @return string
*/
public function getEventType()
{
return $this->eventType;
}
/**
* @param mixed $eventType
*/
public function setEventType($eventType = null)
{
$this->eventType = $eventType;
}
public function isNewsEvent()
{
return (in_array($this->getEventType(), EventCategoryProvider::NEOS_TYPE_NEWS_AND_BRKN) || ($this->getEventType() === EventCategoryProvider::NEOS_TYPE_PROG && in_array($this->getCategoryCode(), EventCategoryProvider::NEOS_NEWS_CAT)));
}
/**
* @return string
*/
public function getResponsibleOffice()
{
return $this->responsibleOffice;
}
/**
* Set responsibleOffice
*
* @param string $responsibleOffice
*
* @return Event
*/
public function setResponsibleOffice($responsibleOffice)
{
$this->responsibleOffice = $responsibleOffice;
return $this;
}
/**
* @return string
*/
public function getResponsibleCode()
{
return $this->responsibleCode;
}
/**
* Set responsibleCode
*
* @param string $responsibleCode
*
* @return Event
*/
public function setResponsibleCode($responsibleCode)
{
$this->responsibleCode = $responsibleCode;
return $this;
}
/**
* @return string
*/
public function getResponsibleDetails()
{
return $this->responsibleDetails;
}
/**
* Set responsibleDetails
*
* @param string $responsibleDetails
*
* @return Event
*/
public function setResponsibleDetails($responsibleDetails)
{
$this->responsibleDetails = $responsibleDetails;
return $this;
}
/**
* @return string
*/
public function getContactOnSite()
{
return $this->contactOnSite;
}
/**
* Set contactOnSite
*
* @param string $contactOnSite
*
* @return Event
*/
public function setContactOnSite($contactOnSite)
{
$this->contactOnSite = $contactOnSite;
return $this;
}
/**
*
* @return string
*/
public function getContactOnSiteDetails()
{
return $this->contactOnSiteDetails;
}
/**
* Set contactOnSiteDetails
*
* @param string $contactOnSiteDetails
*
* @return Event
*/
public function setContactOnSiteDetails($contactOnSiteDetails)
{
$this->contactOnSiteDetails = $contactOnSiteDetails;
return $this;
}
/**
* @return boolean
*/
public function getIsPartialTimingAllowed()
{
return $this->isPartialTimingAllowed;
}
/**
* Set isPartialTimingAllowed
*
* @param boolean $isPartialTimingAllowed
*
* @return Event
*/
public function setIsPartialTimingAllowed($isPartialTimingAllowed)
{
$this->isPartialTimingAllowed = $isPartialTimingAllowed;
return $this;
}
/**
* @return boolean
*/
public function getIsUniOrderAllowed()
{
return $this->isUniOrderAllowed;
}
/**
* Set isUniOrderAllowed
*
* @param boolean $isUniOrderAllowed
*
* @return Event
*/
public function setIsUniOrderAllowed($isUniOrderAllowed)
{
$this->isUniOrderAllowed = $isUniOrderAllowed;
return $this;
}
/**
* @return boolean
*/
public function getRhsBookingAllowed()
{
return $this->rhsBookingAllowed;
}
/**
* @param boolean $rhsBookingAllowed
* @return Event
*/
public function setRhsBookingAllowed($rhsBookingAllowed)
{
$this->rhsBookingAllowed = $rhsBookingAllowed;
return $this;
}
public function __toString(): string
{
return (string)$this->title;
}
/**
* Get id
*
* @return int
*/
public function getId()
{
return $this->id;
}
/**
* Add node
*
* @param Node $node
*
* @return Event
*/
public function addNode(Node $node)
{
$this->nodes[] = $node;
return $this;
}
/**
* Add node
*
* @param WorldFeed $worldFeed
*
*/
public function addWorldFeed(WorldFeed $worldFeed)
{
$this->worldFeeds->add($worldFeed);
$worldFeed->event = $this;
}
/**
* Remove node
*
* @param WorldFeed $node
*/
public function removeWorldFeed(WorldFeed $node)
{
$this->worldFeeds->removeElement($node);
}
/**
* Remove node
*
* @param Node $node
*/
public function removeNode(Node $node)
{
$this->nodes->removeElement($node);
}
/**
* Remove article
*
* @param EventArticle $article
*/
public function removeArticle(EventArticle $article)
{
$this->articles->removeElement($article);
}
/**
* Get article
*
* @return Collection
*/
public function getArticles()
{
return $this->articles;
}
/**
* Set articles
*
* @param Collection
* @return $this
*/
public function setArticles($articles)
{
if (count($articles ?? []) > 0) {
foreach ($articles as $article) {
$this->addArticle($article);
}
}
return $this;
}
/**
* Add article
*
* @param EventArticle $article
*
* @return Event
*/
public function addArticle(EventArticle $article)
{
$article->setEvent($this);
$this->articles[] = $article;
return $this;
}
/**
* @return bool true if at least one article is visible
*/
public function hasPublishedAndVisibleArticles(): bool
{
/**
* @var EventArticle $article
*/
foreach ($this->articles as $article) {
if ($article->isPublishedAndVisible()) {
return true;
}
}
return false;
}
/**
* Add quickLink
*
* @param QuickLink $quickLink
*
* @return Event
*/
public function addQuickLink(QuickLink $quickLink)
{
$quickLink->setEvent($this);
$this->quickLinks[] = $quickLink;
return $this;
}
/**
* Remove quickLink
*
* @param QuickLink $quickLink
*/
public function removeQuickLink(QuickLink $quickLink)
{
$this->quickLinks->removeElement($quickLink);
}
/**
* Get quickLinks
*
* @return Collection
*/
public function getQuickLinks()
{
return $this->quickLinks;
}
/**
* @return mixed
*/
public function getCityName()
{
return $this->cityName;
}
/**
* Set cityName
*
* @param string $cityName
*
* @return Event
*/
public function setCityName($cityName)
{
$this->cityName = $cityName;
return $this;
}
/**
* @return mixed
*/
public function getCountryName()
{
return $this->countryName;
}
/**
* Set countryName
*
* @param string $countryName
*
* @return Event
*/
public function setCountryName($countryName)
{
$this->countryName = $countryName;
return $this;
}
/**
*
* @return string
*/
public function getDescription()
{
return $this->description;
}
/**
* @param string $description
*
* @return Event
*/
public function setDescription($description)
{
$this->description = $description;
return $this;
}
/**
*
* @return string
*/
public function getLongDescription()
{
return $this->longDescription;
}
/**
* @param string $longDescription
*
* @return Event
*/
public function setLongDescription($longDescription)
{
$this->longDescription = $longDescription;
return $this;
}
/**
* @return string
*/
public function getRateCard()
{
return $this->rateCard;
}
/**
* @param string $rateCard
*
* @return Event
*/
public function setRateCard($rateCard)
{
$this->rateCard = $rateCard;
return $this;
}
/**
* @return Gallery
*/
public function getGallery()
{
return $this->gallery;
}
/**
* @param Gallery $gallery
*
* @return Event
*/
public function setGallery(Gallery $gallery = null)
{
$this->gallery = $gallery;
return $this;
}
/**
* Get website
*
* @return string
*/
public function getWebsite()
{
return $this->website;
}
/**
* Set website
*
* @param string $website
*
* @return Event
*/
public function setWebsite($website)
{
$this->website = $website;
return $this;
}
/**
* @return bool
*/
public function isShowUnisInTransmissions(): bool
{
return $this->showUnisInTransmissions === null ? false : $this->showUnisInTransmissions;
}
/**
* @return string
*/
public function getShowUnisInTransmissions(): ?bool
{
return $this->showUnisInTransmissions;
}
/**
* @param bool $showUnisInTransmissions
*/
public function setShowUnisInTransmissions(bool $showUnisInTransmissions): void
{
$this->showUnisInTransmissions = $showUnisInTransmissions;
}
/**
* @return bool
*/
public function isNeosValidConfiguration(): bool
{
return $this->neosValidConfiguration === null ? false : $this->neosValidConfiguration;
}
/**
* @return bool
*/
public function getNeosValidConfiguration(): ?bool
{
return $this->neosValidConfiguration;
}
/**
* @param bool $neosValidConfiguration
*/
public function setNeosValidConfiguration(bool $neosValidConfiguration): void
{
$this->neosValidConfiguration = $neosValidConfiguration;
}
/**
* @return bool
*/
public function isRhsBookingAllowed(): bool
{
return $this->rhsBookingAllowed === null ? false : $this->rhsBookingAllowed;
}
/**
* @return string
*/
public function getNeosConfigurationNote()
{
return $this->neosConfigurationNote;
}
/**
* @param string $neosConfigurationNote
* @return Event
*/
public function setNeosConfigurationNote($neosConfigurationNote)
{
$this->neosConfigurationNote = $neosConfigurationNote;
return $this;
}
/**
* @return bool
*/
public function getShowBookingContact(): ?bool
{
return $this->showBookingContact;
}
/**
* @return bool
*/
public function isShowBookingContact(): bool
{
return $this->showBookingContact === null ? false : $this->showBookingContact;
}
/**
* @param bool $showBookingContact
*/
public function setShowBookingContact(bool $showBookingContact): void
{
$this->showBookingContact = $showBookingContact;
}
/**
* @return bool
*/
public function getShowPastTransmissions(): ?bool
{
return $this->showPastTransmissions;
}
/**
* @return bool
*/
public function isShowPastTransmissions(): bool
{
return $this->showPastTransmissions === null ? false : $this->showPastTransmissions;
}
/**
* @param bool $showPastTransmissions
*/
public function setShowPastTransmissions(bool $showPastTransmissions): void
{
$this->showPastTransmissions = $showPastTransmissions;
}
/**
* @return bool
*/
public function getShowNewsOperationContact(): ?bool
{
return $this->showNewsOperationContact;
}
/**
* @return bool
*/
public function isShowNewsOperationContact(): bool
{
return $this->showNewsOperationContact === null ? false : $this->showNewsOperationContact;
}
/**
* @param bool $showNewsOperationContact
*/
public function setShowNewsOperationContact(bool $showNewsOperationContact): void
{
$this->showNewsOperationContact = $showNewsOperationContact;
}
/**
* @return string
*/
public function getRateCardMember()
{
return $this->rateCardMember;
}
/**
* @param string $rateCardMember
*
* @return Event
*/
public function setRateCardMember($rateCardMember)
{
$this->rateCardMember = $rateCardMember;
return $this;
}
/**
*
* @return string
*/
public function getWorldfeedDescription()
{
return $this->worldfeedDescription;
}
/**
* @param string $worldfeedDescription
*
* @return Event
*/
public function setWorldfeedDescription($worldfeedDescription)
{
$this->worldfeedDescription = $worldfeedDescription;
return $this;
}
/**
* Add related event
*
* @param Event $event
* @return Insight
*/
public function addRelatedEvent(Event $event)
{
if (count($this->relatedEvents ?? []) < 3 && $this->id !== $event->getId()) {
$this->relatedEvents[] = $event;
}
return $this;
}
/**
* Get related events
*
* @return Collection
*/
public function getRelatedEvents()
{
return $this->relatedEvents;
}
/**
* @param mixed $relatedEvents
*/
public function setRelatedEvents($relatedEvents): void
{
$count = count($relatedEvents ?? []);
$this->relatedEvents = new ArrayCollection();
if ($count > 0) {
for ($i = 0; $i < min(3, $count); $i++) {
$this->addRelatedEvent($relatedEvents[$i]);
}
}
}
public function hasRelatedEvents()
{
$eventsShowable = [];
$today = new DateTime("now");
if (count($this->relatedEvents ?? []) > 0) {
foreach ($this->relatedEvents as $event) {
if ($event->visibleFrontend) {
if ($event->endDate > $today) {
$eventsShowable[] = $event;
}
}
}
}
return $eventsShowable;
}
}