src/Entity/Campaign.php line 18

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace App\Entity;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use App\Repository\CampaignRepository;
  8. /**
  9.  * Campaign
  10.  *
  11.  * @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"})})
  12.  * @ORM\Entity(repositoryClass=CampaignRepository::class)
  13.  */
  14. class Campaign
  15. {
  16.     /**
  17.      * @var int
  18.      *
  19.      * @ORM\Column(name="id", type="smallint", nullable=false)
  20.      * @ORM\Id
  21.      * @ORM\GeneratedValue(strategy="IDENTITY")
  22.      */
  23.     private $id;
  24.     /**
  25.      * @var string|null
  26.      *
  27.      * @ORM\Column(name="name", type="string", length=90, nullable=true, options={"default"="NULL"})
  28.      */
  29.     private $name null;
  30.     /**
  31.      * @var \DateTime
  32.      *
  33.      * @ORM\Column(name="start_date", type="date", nullable=false)
  34.      */
  35.     private $startDate;
  36.     /**
  37.      * @var \DateTime
  38.      *
  39.      * @ORM\Column(name="end_date", type="date", nullable=false)
  40.      */
  41.     private $endDate;
  42.     /**
  43.      * @var bool
  44.      *
  45.      * @ORM\Column(name="final_report", type="boolean", nullable=false)
  46.      */
  47.     private $finalReport false;
  48.     /**
  49.      * @var string|null
  50.      *
  51.      * @ORM\Column(name="objective", type="string", length=32, nullable=true, options={"default"="NULL"})
  52.      */
  53.     private $objective null;
  54.     /**
  55.      * @var string|null
  56.      *
  57.      * @ORM\Column(name="duration", type="string", length=64, nullable=true, options={"default"="NULL"})
  58.      */
  59.     private $duration null;
  60.     /**
  61.      * @var bool
  62.      *
  63.      * @ORM\Column(name="is_finished", type="boolean", nullable=false)
  64.      */
  65.     private $isFinished false;
  66.     /**
  67.      * @var \CampaignType
  68.      *
  69.      * @ORM\ManyToOne(targetEntity="CampaignType")
  70.      * @ORM\JoinColumns({
  71.      *   @ORM\JoinColumn(name="campaign_type_id", referencedColumnName="id")
  72.      * })
  73.      */
  74.     private $campaignType;
  75.     /**
  76.      * @var \Customer
  77.      *
  78.      * @ORM\ManyToOne(targetEntity="Customer")
  79.      * @ORM\JoinColumns({
  80.      *   @ORM\JoinColumn(name="client_id", referencedColumnName="id")
  81.      * })
  82.      */
  83.     private $client;
  84.     /**
  85.      * @var \User
  86.      *
  87.      * @ORM\ManyToOne(targetEntity="User")
  88.      * @ORM\JoinColumns({
  89.      *   @ORM\JoinColumn(name="user_id", referencedColumnName="id")
  90.      * })
  91.      */
  92.     private $user;
  93.     /**
  94.      * @var \Doctrine\Common\Collections\Collection
  95.      *
  96.      * @ORM\ManyToMany(targetEntity="Conference", inversedBy="campaign")
  97.      * @ORM\JoinTable(name="campaign_conference",
  98.      *   joinColumns={
  99.      *     @ORM\JoinColumn(name="campaign_id", referencedColumnName="id")
  100.      *   },
  101.      *   inverseJoinColumns={
  102.      *     @ORM\JoinColumn(name="conference_id", referencedColumnName="id")
  103.      *   }
  104.      * )
  105.      */
  106.     private $conference;
  107.     /**
  108.      * @var \Doctrine\Common\Collections\Collection
  109.      *
  110.      * @ORM\ManyToMany(targetEntity="User", mappedBy="compaignid")
  111.      */
  112.     private $userid;
  113.     /**
  114.      * Constructor
  115.      */
  116.     public function __construct()
  117.     {
  118.         $this->conference = new ArrayCollection();
  119.         $this->userid = new ArrayCollection();
  120.     }
  121.     public function getId(): ?int
  122.     {
  123.         return $this->id;
  124.     }
  125.     public function getName(): ?string
  126.     {
  127.         return $this->name;
  128.     }
  129.     public function setName(?string $name): self
  130.     {
  131.         $this->name $name;
  132.         return $this;
  133.     }
  134.     public function getStartDate(): ?\DateTimeInterface
  135.     {
  136.         return $this->startDate;
  137.     }
  138.     public function setStartDate(\DateTimeInterface $startDate): self
  139.     {
  140.         $this->startDate $startDate;
  141.         return $this;
  142.     }
  143.     public function getEndDate(): ?\DateTimeInterface
  144.     {
  145.         return $this->endDate;
  146.     }
  147.     public function setEndDate(\DateTimeInterface $endDate): self
  148.     {
  149.         $this->endDate $endDate;
  150.         return $this;
  151.     }
  152.     public function isFinalReport(): ?bool
  153.     {
  154.         return $this->finalReport;
  155.     }
  156.     public function setFinalReport(bool $finalReport): self
  157.     {
  158.         $this->finalReport $finalReport;
  159.         return $this;
  160.     }
  161.     public function getObjective(): ?string
  162.     {
  163.         return $this->objective;
  164.     }
  165.     public function setObjective(?string $objective): self
  166.     {
  167.         $this->objective $objective;
  168.         return $this;
  169.     }
  170.     public function getCampaignType(): ?CampaignType
  171.     {
  172.         return $this->campaignType;
  173.     }
  174.     public function setCampaignType(?CampaignType $campaignType): self
  175.     {
  176.         $this->campaignType $campaignType;
  177.         return $this;
  178.     }
  179.     public function getClient(): ?Customer
  180.     {
  181.         return $this->client;
  182.     }
  183.     public function setClient(?Customer $client): self
  184.     {
  185.         $this->client $client;
  186.         return $this;
  187.     }
  188.     public function getUser(): ?User
  189.     {
  190.         return $this->user;
  191.     }
  192.     public function setUser(?User $user): self
  193.     {
  194.         $this->user $user;
  195.         return $this;
  196.     }
  197.     /**
  198.      * @return Collection<int, Conference>
  199.      */
  200.     public function getConference(): Collection
  201.     {
  202.         return $this->conference;
  203.     }
  204.     public function addConference(Conference $conference): self
  205.     {
  206.         if (!$this->conference->contains($conference)) {
  207.             $this->conference[] = $conference;
  208.         }
  209.         return $this;
  210.     }
  211.     public function removeConference(Conference $conference): self
  212.     {
  213.         $this->conference->removeElement($conference);
  214.         return $this;
  215.     }
  216.     /**
  217.      * @return Collection<int, User>
  218.      */
  219.     public function getUserid(): Collection
  220.     {
  221.         return $this->userid;
  222.     }
  223.     public function addUserid(User $userid): self
  224.     {
  225.         if (!$this->userid->contains($userid)) {
  226.             $this->userid[] = $userid;
  227.             $userid->addCompaignid($this);
  228.         }
  229.         return $this;
  230.     }
  231.     public function removeUserid(User $userid): self
  232.     {
  233.         if ($this->userid->removeElement($userid)) {
  234.             $userid->removeCompaignid($this);
  235.         }
  236.         return $this;
  237.     }
  238.     public function getDuration(): ?string
  239.     {
  240.         return $this->duration;
  241.     }
  242.     public function setDuration(?string $duration): self
  243.     {
  244.         $this->duration $duration;
  245.         return $this;
  246.     }
  247.     public function isIsFinished(): ?bool
  248.     {
  249.         return $this->isFinished;
  250.     }
  251.     public function setIsFinished(bool $isFinished): self
  252.     {
  253.         $this->isFinished $isFinished;
  254.         return $this;
  255.     }
  256. }