<?php
namespace App\Entity;
use App\Repository\LiveRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
use JMS\Serializer\Annotation as Serializer;
/**
* @ORM\Entity(repositoryClass=LiveRepository::class)
* @Serializer\ExclusionPolicy("ALL")
*/
class Live extends BaseEntity
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
* @Serializer\Expose
* @Serializer\Groups({"live_participation", "live_list"})
*/
private $id;
/**
* @ORM\Column(type="string", length=255)
* @Serializer\Expose
* @Serializer\Groups({"live_participation", "live_list"})
*/
private $title;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $description;
/**
* @ORM\OneToMany(targetEntity=Course::class, mappedBy="live", cascade={"remove"}, fetch="EXTRA_LAZY")
*/
private $courses;
/**
* @ORM\Column(type="string", length=255)
* @Serializer\Expose
* @Serializer\Groups({"live_participation", "live_list"})
*/
private $type;
/**
* @ORM\ManyToMany(targetEntity=User::class, inversedBy="lives")
* @Serializer\Expose
* @Serializer\Groups({"live_details"})
*/
private $coaches;
/**
* @ORM\OneToMany(targetEntity=SubsidiaryCompany::class, mappedBy="live", cascade={"remove"}, fetch="EXTRA_LAZY")
*/
private $subsidiaryCompanies;
/**
* @ORM\OneToMany(targetEntity=Job::class, mappedBy="live", cascade={"remove"}, fetch="EXTRA_LAZY")
*/
private $jobs;
/**
* @ORM\OneToMany(targetEntity=Office::class, mappedBy="live", cascade={"remove"}, fetch="EXTRA_LAZY")
*/
private $offices;
/**
* @ORM\OneToMany(targetEntity=Contract::class, mappedBy="live", cascade={"remove"}, fetch="EXTRA_LAZY")
*/
private $contracts;
/**
* @ORM\Column(type="boolean")
*/
private $isAllJobs = true;
/**
* @ORM\Column(type="boolean")
*/
private $isAllOffices = true;
/**
* @ORM\Column(type="boolean")
*/
private $isAllContracts = true;
/**
* @ORM\Column(type="boolean")
*/
private $isAllSubsidiaryCompanies = true;
/**
* @ORM\OneToOne(targetEntity=ImageManager::class, cascade={"persist", "remove"})
* @Serializer\Expose
* @Serializer\Groups({"live_participation", "live_list"})
*/
private $cover;
/**
* @ORM\Column(type="boolean")
*/
private $isPublished = false;
/**
* @ORM\Column(type="json", nullable=true)
*/
private $knowledges = [];
/**
* @ORM\Column(type="datetime", nullable=true)
* @Serializer\Expose
* @Serializer\Groups({"live_list"})
*/
private $startAt;
/**
* @ORM\Column(type="datetime", nullable=true)
* @Serializer\Expose
* @Serializer\Groups({"live_list"})
*/
private $endAt;
/**
* @Gedmo\Slug(fields={"title"})
* @ORM\Column(length=191)
*/
private $slug;
/**
* @ORM\OneToMany(targetEntity=ModuleItem::class, mappedBy="live", cascade={"persist", "remove"}, fetch="EXTRA_LAZY")
*/
private $moduleItems;
/**
* @ORM\OneToMany(targetEntity=ModuleParticipation::class, mappedBy="live", cascade={"persist", "remove"}, fetch="EXTRA_LAZY")
*/
private $moduleParticipations;
/**
* @ORM\Column(type="time", nullable=true)
*/
private $time;
/**
* @ORM\OneToMany(targetEntity=LiveParticipant::class, mappedBy="live", cascade={"remove"}, fetch="EXTRA_LAZY")
*/
private $liveParticipants;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $isDoNotMiss;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $rejectReason;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $currentPlace;
/**
* @ORM\ManyToMany(targetEntity=Module::class, inversedBy="lives")
* @Serializer\Expose
* @Serializer\Groups({"live_details"})
*/
private $modules;
/**
* @ORM\OneToMany(targetEntity=LiveView::class, mappedBy="live", orphanRemoval=true, fetch="EXTRA_LAZY")
*/
private $liveViews;
/**
* @ORM\Column(type="string", length=1000000, nullable=true)
*/
private $reviewReason;
/**
* @ORM\OneToMany(targetEntity=LiveRecord::class, mappedBy="live", orphanRemoval=true, fetch="EXTRA_LAZY")
*/
private $liveRecords;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $startingNotificationSent = false;
public function __construct()
{
$this->courses = new ArrayCollection();
$this->coaches = new ArrayCollection();
$this->subsidiaryCompanies = new ArrayCollection();
$this->jobs = new ArrayCollection();
$this->offices = new ArrayCollection();
$this->contracts = new ArrayCollection();
$this->moduleItems = new ArrayCollection();
$this->moduleParticipations = new ArrayCollection();
$this->liveParticipants = new ArrayCollection();
$this->modules = new ArrayCollection();
$this->liveViews = new ArrayCollection();
$this->liveRecords = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getTitle(): ?string
{
return $this->title;
}
public function setTitle(string $title): self
{
$this->title = $title;
return $this;
}
public function getDescription(): ?string
{
return $this->description;
}
public function setDescription(?string $description): self
{
$this->description = $description;
return $this;
}
/**
* @return Collection<int, Course>
*/
public function getCourses(): Collection
{
return $this->courses;
}
public function addCourse(Course $course): self
{
if (!$this->courses->contains($course)) {
$this->courses[] = $course;
$course->setLive($this);
}
return $this;
}
public function removeCourse(Course $course): self
{
if ($this->courses->removeElement($course)) {
// set the owning side to null (unless already changed)
if ($course->getLive() === $this) {
$course->setLive(null);
}
}
return $this;
}
public function getType(): ?string
{
return $this->type;
}
public function setType(string $type): self
{
$this->type = $type;
return $this;
}
/**
* @return Collection<int, User>
*/
public function getCoaches(): Collection
{
return $this->coaches;
}
public function addCoach(User $coach): self
{
if (!$this->coaches->contains($coach)) {
$this->coaches[] = $coach;
}
return $this;
}
public function removeCoach(User $coach): self
{
$this->coaches->removeElement($coach);
return $this;
}
/**
* @return Collection<int, SubsidiaryCompany>
*/
public function getSubsidiaryCompanies(): Collection
{
return $this->subsidiaryCompanies;
}
public function addSubsidiaryCompany(SubsidiaryCompany $subsidiaryCompany): self
{
if (!$this->subsidiaryCompanies->contains($subsidiaryCompany)) {
$this->subsidiaryCompanies[] = $subsidiaryCompany;
$subsidiaryCompany->setLive($this);
}
return $this;
}
public function removeSubsidiaryCompany(SubsidiaryCompany $subsidiaryCompany): self
{
if ($this->subsidiaryCompanies->removeElement($subsidiaryCompany)) {
// set the owning side to null (unless already changed)
if ($subsidiaryCompany->getLive() === $this) {
$subsidiaryCompany->setLive(null);
}
}
return $this;
}
/**
* @return Collection<int, Job>
*/
public function getJobs(): Collection
{
return $this->jobs;
}
public function addJob(Job $job): self
{
if (!$this->jobs->contains($job)) {
$this->jobs[] = $job;
$job->setLive($this);
}
return $this;
}
public function removeJob(Job $job): self
{
if ($this->jobs->removeElement($job)) {
// set the owning side to null (unless already changed)
if ($job->getLive() === $this) {
$job->setLive(null);
}
}
return $this;
}
/**
* @return Collection<int, Office>
*/
public function getOffices(): Collection
{
return $this->offices;
}
public function addOffice(Office $office): self
{
if (!$this->offices->contains($office)) {
$this->offices[] = $office;
$office->setLive($this);
}
return $this;
}
public function removeOffice(Office $office): self
{
if ($this->offices->removeElement($office)) {
// set the owning side to null (unless already changed)
if ($office->getLive() === $this) {
$office->setLive(null);
}
}
return $this;
}
/**
* @return Collection<int, Contract>
*/
public function getContracts(): Collection
{
return $this->contracts;
}
public function addContract(Contract $contract): self
{
if (!$this->contracts->contains($contract)) {
$this->contracts[] = $contract;
$contract->setLive($this);
}
return $this;
}
public function removeContract(Contract $contract): self
{
if ($this->contracts->removeElement($contract)) {
// set the owning side to null (unless already changed)
if ($contract->getLive() === $this) {
$contract->setLive(null);
}
}
return $this;
}
public function isIsAllJobs(): ?bool
{
return $this->isAllJobs;
}
public function setIsAllJobs(bool $isAllJobs): self
{
$this->isAllJobs = $isAllJobs;
return $this;
}
public function isIsAllOffices(): ?bool
{
return $this->isAllOffices;
}
public function setIsAllOffices(bool $isAllOffices): self
{
$this->isAllOffices = $isAllOffices;
return $this;
}
public function isIsAllContracts(): ?bool
{
return $this->isAllContracts;
}
public function setIsAllContracts(bool $isAllContracts): self
{
$this->isAllContracts = $isAllContracts;
return $this;
}
public function isIsAllSubsidiaryCompanies(): ?bool
{
return $this->isAllSubsidiaryCompanies;
}
public function setIsAllSubsidiaryCompanies(bool $isAllSubsidiaryCompanies): self
{
$this->isAllSubsidiaryCompanies = $isAllSubsidiaryCompanies;
return $this;
}
public function getCover(): ?ImageManager
{
return $this->cover;
}
public function setCover(?ImageManager $cover): self
{
$this->cover = $cover;
return $this;
}
public function isIsPublished(): ?bool
{
return $this->isPublished;
}
public function setIsPublished(bool $isPublished): self
{
$this->isPublished = $isPublished;
return $this;
}
public function getKnowledges(): ?array
{
return $this->knowledges;
}
public function setKnowledges(?array $knowledges): self
{
$this->knowledges = $knowledges;
return $this;
}
public function getStartAt(): ?\DateTimeInterface
{
return $this->startAt;
}
public function setStartAt(?\DateTimeInterface $startAt): self
{
$this->startAt = $startAt;
return $this;
}
public function getEndAt(): ?\DateTimeInterface
{
return $this->endAt;
}
public function setEndAt(?\DateTimeInterface $endAt): self
{
$this->endAt = $endAt;
return $this;
}
/**
* Get the value of slug
*/
public function getSlug()
{
return $this->slug;
}
/**
* Set the value of slug
*
* @return self
*/
public function setSlug($slug)
{
$this->slug = $slug;
return $this;
}
/**
* @return Collection<int, ModuleItem>
*/
public function getModuleItems(): Collection
{
return $this->moduleItems;
}
public function addModuleItem(ModuleItem $moduleItem): self
{
if (!$this->moduleItems->contains($moduleItem)) {
$this->moduleItems[] = $moduleItem;
$moduleItem->setLive($this);
}
return $this;
}
public function removeModuleItem(ModuleItem $moduleItem): self
{
if ($this->moduleItems->removeElement($moduleItem)) {
// set the owning side to null (unless already changed)
if ($moduleItem->getLive() === $this) {
$moduleItem->setLive(null);
}
}
return $this;
}
/**
* @return Collection<int, ModuleParticipation>
*/
public function getModuleParticipations(): Collection
{
return $this->moduleParticipations;
}
public function addModuleParticipation(ModuleParticipation $moduleParticipation): self
{
if (!$this->moduleParticipations->contains($moduleParticipation)) {
$this->moduleParticipations[] = $moduleParticipation;
$moduleParticipation->setLive($this);
}
return $this;
}
public function removeModuleParticipation(ModuleParticipation $moduleParticipation): self
{
if ($this->moduleParticipations->removeElement($moduleParticipation)) {
// set the owning side to null (unless already changed)
if ($moduleParticipation->getLive() === $this) {
$moduleParticipation->setLive(null);
}
}
return $this;
}
public function getTime(): ?\DateTimeInterface
{
return $this->time;
}
public function setTime(?\DateTimeInterface $time): self
{
$this->time = $time;
return $this;
}
/**
* @return Collection<int, LiveParticipant>
*/
public function getLiveParticipants(): Collection
{
return $this->liveParticipants;
}
public function addLiveParticipant(LiveParticipant $liveParticipant): self
{
if (!$this->liveParticipants->contains($liveParticipant)) {
$this->liveParticipants[] = $liveParticipant;
$liveParticipant->setLive($this);
}
return $this;
}
public function removeLiveParticipant(LiveParticipant $liveParticipant): self
{
if ($this->liveParticipants->removeElement($liveParticipant)) {
// set the owning side to null (unless already changed)
if ($liveParticipant->getLive() === $this) {
$liveParticipant->setLive(null);
}
}
return $this;
}
public function isIsDoNotMiss(): ?bool
{
return $this->isDoNotMiss;
}
public function setIsDoNotMiss(?bool $isDoNotMiss): self
{
$this->isDoNotMiss = $isDoNotMiss;
return $this;
}
public function getRejectReason(): ?string
{
return $this->rejectReason;
}
public function setRejectReason(?string $rejectReason): self
{
$this->rejectReason = $rejectReason;
return $this;
}
public function getCurrentPlace(): ?string
{
return $this->currentPlace;
}
public function setCurrentPlace(?string $currentPlace): self
{
$this->currentPlace = $currentPlace;
return $this;
}
/**
* @return Collection<int, Module>
*/
public function getModules(): Collection
{
return $this->modules;
}
public function addModule(Module $module): self
{
if (!$this->modules->contains($module)) {
$this->modules[] = $module;
}
return $this;
}
public function removeModule(Module $module): self
{
$this->modules->removeElement($module);
return $this;
}
/**
* @return Collection<int, LiveView>
*/
public function getLiveViews(): Collection
{
return $this->liveViews;
}
public function addLiveView(LiveView $liveView): self
{
if (!$this->liveViews->contains($liveView)) {
$this->liveViews[] = $liveView;
$liveView->setLive($this);
}
return $this;
}
public function removeLiveView(LiveView $liveView): self
{
if ($this->liveViews->removeElement($liveView)) {
// set the owning side to null (unless already changed)
if ($liveView->getLive() === $this) {
$liveView->setLive(null);
}
}
return $this;
}
public function getReviewReason(): ?string
{
return $this->reviewReason;
}
public function setReviewReason(?string $reviewReason): self
{
$this->reviewReason = $reviewReason;
return $this;
}
/**
* @return Collection<int, LiveRecord>
*/
public function getLiveRecords(): Collection
{
return $this->liveRecords;
}
public function addLiveRecord(LiveRecord $liveRecord): self
{
if (!$this->liveRecords->contains($liveRecord)) {
$this->liveRecords[] = $liveRecord;
$liveRecord->setLive($this);
}
return $this;
}
public function removeLiveRecord(LiveRecord $liveRecord): self
{
if ($this->liveRecords->removeElement($liveRecord)) {
// set the owning side to null (unless already changed)
if ($liveRecord->getLive() === $this) {
$liveRecord->setLive(null);
}
}
return $this;
}
public function isStartingNotificationSent(): ?bool
{
return $this->startingNotificationSent;
}
public function setStartingNotificationSent(?bool $startingNotificationSent): self
{
$this->startingNotificationSent = $startingNotificationSent;
return $this;
}
}