<?php
namespace App\Entity;
use App\Repository\LandingpageRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: LandingpageRepository::class)]
#[ORM\HasLifecycleCallbacks]
class Landingpage
{
use \App\Traits\EntityDateTimeAbleTrait;
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: 'integer')]
private $id;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private ?string $name = null;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private ?string $slug = null;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private ?string $eventName = null;
#[ORM\Column(type: 'date')]
private ?\DateTimeInterface $eventDate = null;
#[ORM\OneToMany(targetEntity: Profile::class, mappedBy: 'landingpage')]
private Collection $profiles;
#[ORM\OneToMany(mappedBy: 'landingpage', targetEntity: LandingpageFile::class)]
private Collection $landingpageFiles;
#[ORM\Column(length: 255, nullable: true)]
private ?string $video = null;
#[ORM\Column(type: Types::TEXT, nullable: true)]
private ?string $description = null;
#[ORM\Column(type: Types::DATETIME_MUTABLE, nullable: true)]
private ?\DateTimeInterface $eventEndDate = null;
#[ORM\ManyToOne(inversedBy: 'landingpages')]
private ?Campaign $campaign = null;
#[ORM\Column(nullable: true)]
private ?bool $isAgent = null;
public function __construct()
{
$this->profiles = new ArrayCollection();
$this->landingpageFiles = new ArrayCollection();
}
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 getSlug(): ?string
{
return $this->slug;
}
public function setSlug(?string $slug): self
{
$this->slug = $slug;
return $this;
}
public function getEventName(): ?string
{
return $this->eventName;
}
public function setEventName(?string $eventName): self
{
$this->eventName = $eventName;
return $this;
}
public function getEventDate(): ?\DateTimeInterface
{
return $this->eventDate;
}
public function setEventDate(\DateTimeInterface $eventDate): self
{
$this->eventDate = $eventDate;
return $this;
}
/**
* @return Collection<int, Profile>
*/
public function getProfiles(): Collection
{
return $this->profiles;
}
public function addProfile(Profile $profile): self
{
if (!$this->profiles->contains($profile)) {
$this->profiles[] = $profile;
$profile->setLandingpage($this);
}
return $this;
}
public function removeProfile(Profile $profile): self
{
if ($this->profiles->removeElement($profile)) {
// set the owning side to null (unless already changed)
if ($profile->getLandingpage() === $this) {
$profile->setLandingpage(null);
}
}
return $this;
}
/**
* @return Collection<int, LandingpageFile>
*/
public function getLandingpageFiles(): Collection
{
return $this->landingpageFiles;
}
public function addLandingpageFile(LandingpageFile $landingpageFile): static
{
if (!$this->landingpageFiles->contains($landingpageFile)) {
$this->landingpageFiles->add($landingpageFile);
$landingpageFile->setLandingpage($this);
}
return $this;
}
public function removeLandingpageFile(LandingpageFile $landingpageFile): static
{
if ($this->landingpageFiles->removeElement($landingpageFile)) {
// set the owning side to null (unless already changed)
if ($landingpageFile->getLandingpage() === $this) {
$landingpageFile->setLandingpage(null);
}
}
return $this;
}
public function getVideo(): ?string
{
return $this->video;
}
public function setVideo(?string $video): static
{
$this->video = $video;
return $this;
}
public function getDescription(): ?string
{
return $this->description;
}
public function setDescription(?string $description): static
{
$this->description = $description;
return $this;
}
public function getEventEndDate(): ?\DateTimeInterface
{
return $this->eventEndDate;
}
public function setEventEndDate(?\DateTimeInterface $eventEndDate): static
{
$this->eventEndDate = $eventEndDate;
return $this;
}
public function getCampaign(): ?Campaign
{
return $this->campaign;
}
public function setCampaign(?Campaign $campaign): static
{
$this->campaign = $campaign;
return $this;
}
public function isIsAgent(): ?bool
{
return $this->isAgent;
}
public function setIsAgent(?bool $isAgent): static
{
$this->isAgent = $isAgent;
return $this;
}
}