<?php
namespace App\Entity;
use App\Repository\EventRepository;
use App\String\Constant;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: EventRepository::class)]
class Event
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: 'integer')]
private $id;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $name;
#[ORM\Column(type: 'date', nullable: true)]
private $startDate;
#[ORM\Column(type: 'date', nullable: true)]
private $endDate;
#[ORM\Column(type: 'time', nullable: true)]
private $startTime;
#[ORM\Column(type: 'time', nullable: true)]
private $endTime;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $thubmnail;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $ticketUrl;
#[ORM\Column(type: 'array', nullable: true)]
private $issueAreas = [];
#[ORM\Column(type: 'text', nullable: true)]
private $description;
#[ORM\Column(type: 'integer', nullable: true)]
private $wordpressId;
#[ORM\Column(length: 255, nullable: true)]
private ?string $eventRsvpInfo = null;
#[ORM\Column(nullable: true)]
private ?bool $isOnline = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $address = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $city = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $state = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $country = null;
public function getId(): ?int
{
return $this->id;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(?string $name): self
{
$this->name = $name;
return $this;
}
public function getStartDate(): ?\DateTimeInterface
{
return $this->startDate;
}
public function setStartDate(?\DateTimeInterface $startDate): self
{
$this->startDate = $startDate;
return $this;
}
public function getEndDate(): ?\DateTimeInterface
{
return $this->endDate;
}
public function setEndDate(?\DateTimeInterface $endDate): self
{
$this->endDate = $endDate;
return $this;
}
public function getStartTime(): ?\DateTimeInterface
{
return $this->startTime;
}
public function setStartTime(?\DateTimeInterface $startTime): self
{
$this->startTime = $startTime;
return $this;
}
public function getEndTime(): ?\DateTimeInterface
{
return $this->endTime;
}
public function setEndTime(?\DateTimeInterface $endTime): self
{
$this->endTime = $endTime;
return $this;
}
public function getThubmnail(): ?string
{
return $this->thubmnail;
}
public function setThubmnail(?string $thubmnail): self
{
$this->thubmnail = $thubmnail;
return $this;
}
public function getThumbnailUrl(): ?string
{
$url = '';
if ($this->thubmnail) {
$url = '/uploads/events/' . $this->thubmnail;
}
return $url;
}
public function getTicketUrl(): ?string
{
return $this->ticketUrl;
}
public function setTicketUrl(?string $ticketUrl): self
{
$this->ticketUrl = $ticketUrl;
return $this;
}
public function getIssueAreas(): ?array
{
return $this->issueAreas;
}
public function setIssueAreas(?array $issueAreas): self
{
$this->issueAreas = $issueAreas;
return $this;
}
public function getDescription(): ?string
{
return $this->description;
}
public function setDescription(?string $description): self
{
$this->description = $description;
return $this;
}
public function getWordpressId(): ?int
{
return $this->wordpressId;
}
public function setWordpressId(?int $wordpressId): self
{
$this->wordpressId = $wordpressId;
return $this;
}
public function getWordpressUrl(): string
{
$url = '';
if ($this->wordpressId) {
$url = Constant::WORDPRESS_URL . '/?page_id='. $this->wordpressId;
}
return $url;
}
public function getEventRsvpInfo(): ?string
{
return $this->eventRsvpInfo;
}
public function setEventRsvpInfo(?string $eventRsvpInfo): self
{
$this->eventRsvpInfo = $eventRsvpInfo;
return $this;
}
public function isIsOnline(): ?bool
{
return $this->isOnline;
}
public function setIsOnline(?bool $isOnline): self
{
$this->isOnline = $isOnline;
return $this;
}
public function getAddress(): ?string
{
return $this->address;
}
public function setAddress(?string $address): self
{
$this->address = $address;
return $this;
}
public function getCity(): ?string
{
return $this->city;
}
public function setCity(?string $city): self
{
$this->city = $city;
return $this;
}
public function getState(): ?string
{
return $this->state;
}
public function setState(?string $state): self
{
$this->state = $state;
return $this;
}
public function getCountry(): ?string
{
return $this->country;
}
public function setCountry(?string $country): self
{
$this->country = $country;
return $this;
}
public function getEventDateStatus(): ?bool
{
$today = new \DateTime('today');
if ($today > $this->endDate) {
return false;
}
return true;
}
}