<?php
declare(strict_types=1);
namespace App\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use App\Repository\CampaignRepository;
/**
* Campaign
*
* @ORM\Table(name="campaign", indexes={@ORM\Index(name="clientID", columns={"client_id"}), @ORM\Index(name="campaign_type", columns={"campaign_type_id"}), @ORM\Index(name="userID", columns={"user_id"})})
* @ORM\Entity(repositoryClass=CampaignRepository::class)
*/
class Campaign
{
/**
* @var int
*
* @ORM\Column(name="id", type="smallint", nullable=false)
* @ORM\Id
* @ORM\GeneratedValue(strategy="IDENTITY")
*/
private $id;
/**
* @var string|null
*
* @ORM\Column(name="name", type="string", length=90, nullable=true, options={"default"="NULL"})
*/
private $name = null;
/**
* @var \DateTime
*
* @ORM\Column(name="start_date", type="date", nullable=false)
*/
private $startDate;
/**
* @var \DateTime
*
* @ORM\Column(name="end_date", type="date", nullable=false)
*/
private $endDate;
/**
* @var bool
*
* @ORM\Column(name="final_report", type="boolean", nullable=false)
*/
private $finalReport = false;
/**
* @var string|null
*
* @ORM\Column(name="objective", type="string", length=32, nullable=true, options={"default"="NULL"})
*/
private $objective = null;
/**
* @var string|null
*
* @ORM\Column(name="duration", type="string", length=64, nullable=true, options={"default"="NULL"})
*/
private $duration = null;
/**
* @var bool
*
* @ORM\Column(name="is_finished", type="boolean", nullable=false)
*/
private $isFinished = false;
/**
* @var \CampaignType
*
* @ORM\ManyToOne(targetEntity="CampaignType")
* @ORM\JoinColumns({
* @ORM\JoinColumn(name="campaign_type_id", referencedColumnName="id")
* })
*/
private $campaignType;
/**
* @var \Customer
*
* @ORM\ManyToOne(targetEntity="Customer")
* @ORM\JoinColumns({
* @ORM\JoinColumn(name="client_id", referencedColumnName="id")
* })
*/
private $client;
/**
* @var \User
*
* @ORM\ManyToOne(targetEntity="User")
* @ORM\JoinColumns({
* @ORM\JoinColumn(name="user_id", referencedColumnName="id")
* })
*/
private $user;
/**
* @var \Doctrine\Common\Collections\Collection
*
* @ORM\ManyToMany(targetEntity="Conference", inversedBy="campaign")
* @ORM\JoinTable(name="campaign_conference",
* joinColumns={
* @ORM\JoinColumn(name="campaign_id", referencedColumnName="id")
* },
* inverseJoinColumns={
* @ORM\JoinColumn(name="conference_id", referencedColumnName="id")
* }
* )
*/
private $conference;
/**
* @var \Doctrine\Common\Collections\Collection
*
* @ORM\ManyToMany(targetEntity="User", mappedBy="compaignid")
*/
private $userid;
/**
* Constructor
*/
public function __construct()
{
$this->conference = new ArrayCollection();
$this->userid = 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 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 isFinalReport(): ?bool
{
return $this->finalReport;
}
public function setFinalReport(bool $finalReport): self
{
$this->finalReport = $finalReport;
return $this;
}
public function getObjective(): ?string
{
return $this->objective;
}
public function setObjective(?string $objective): self
{
$this->objective = $objective;
return $this;
}
public function getCampaignType(): ?CampaignType
{
return $this->campaignType;
}
public function setCampaignType(?CampaignType $campaignType): self
{
$this->campaignType = $campaignType;
return $this;
}
public function getClient(): ?Customer
{
return $this->client;
}
public function setClient(?Customer $client): self
{
$this->client = $client;
return $this;
}
public function getUser(): ?User
{
return $this->user;
}
public function setUser(?User $user): self
{
$this->user = $user;
return $this;
}
/**
* @return Collection<int, Conference>
*/
public function getConference(): Collection
{
return $this->conference;
}
public function addConference(Conference $conference): self
{
if (!$this->conference->contains($conference)) {
$this->conference[] = $conference;
}
return $this;
}
public function removeConference(Conference $conference): self
{
$this->conference->removeElement($conference);
return $this;
}
/**
* @return Collection<int, User>
*/
public function getUserid(): Collection
{
return $this->userid;
}
public function addUserid(User $userid): self
{
if (!$this->userid->contains($userid)) {
$this->userid[] = $userid;
$userid->addCompaignid($this);
}
return $this;
}
public function removeUserid(User $userid): self
{
if ($this->userid->removeElement($userid)) {
$userid->removeCompaignid($this);
}
return $this;
}
public function getDuration(): ?string
{
return $this->duration;
}
public function setDuration(?string $duration): self
{
$this->duration = $duration;
return $this;
}
public function isIsFinished(): ?bool
{
return $this->isFinished;
}
public function setIsFinished(bool $isFinished): self
{
$this->isFinished = $isFinished;
return $this;
}
}