src/Entity/SurveyCampaignSubmission.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use DateTime;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Symfony\Component\Validator\Constraints as Assert;
  6. /**
  7.  * @ORM\Entity(repositoryClass="App\Repository\SurveyCampaignSubmissionRepository")
  8.  */
  9. class SurveyCampaignSubmission
  10. {
  11.     /**
  12.      * @ORM\Id()
  13.      * @ORM\GeneratedValue()
  14.      * @ORM\Column(type="integer")
  15.      */
  16.     private $id;
  17.     /**
  18.      * @ORM\Column(type="integer")
  19.      */
  20.     private $submissionId;
  21.     /**
  22.      * @ORM\ManyToOne(targetEntity="App\Entity\SurveyCampaign", inversedBy="surveyCampaignSubmissions")
  23.      * @ORM\JoinColumn(nullable=false, onDelete="CASCADE")
  24.      */
  25.     private $surveyCampaign;
  26.     /**
  27.      * @ORM\ManyToOne(targetEntity="App\Entity\Company", inversedBy="surveyCampaignSubmissions")
  28.      * @ORM\JoinColumn(nullable=false, onDelete="CASCADE")
  29.      */
  30.     private $company;
  31.     /**
  32.      * @var User
  33.      *
  34.      * @ORM\ManyToOne(targetEntity="App\Entity\User")
  35.      * @ORM\JoinColumn(nullable=false, onDelete="CASCADE")
  36.      */
  37.     private $user;
  38.     /**
  39.      * @var SurveyFormQuestion
  40.      *
  41.      * @ORM\ManyToOne(targetEntity="App\Entity\SurveyFormQuestion")
  42.      * @ORM\JoinColumn(nullable=false, onDelete="CASCADE")
  43.      * @Assert\NotNull()
  44.      */
  45.     private $formQuestion;
  46.     /**
  47.      * @var DateTime
  48.      *
  49.      * @ORM\Column(type="datetime", nullable=false)
  50.      */
  51.     private $createdAt;
  52.     /**
  53.      * @var DateTime
  54.      *
  55.      * @ORM\Column(type="datetime", nullable=true)
  56.      */
  57.     private $updatedAt;
  58.     /**
  59.      * Company constructor.
  60.      */
  61.     public function __construct()
  62.     {
  63.         $this->createdAt = new \DateTime();
  64.         $this->updatedAt = new \DateTime();
  65.     }
  66.     /**
  67.      * @return string
  68.      */
  69.     public function __toString()
  70.     {
  71.         return 'Submission Id: '.$this->submissionId.', Company: '.$this->getCompany()->getName();
  72.     }
  73.     public function getId(): ?int
  74.     {
  75.         return $this->id;
  76.     }
  77.     public function getSubmissionId(): ?int
  78.     {
  79.         return $this->submissionId;
  80.     }
  81.     public function setSubmissionId(?int $submissionId): self
  82.     {
  83.         $this->submissionId $submissionId;
  84.         return $this;
  85.     }
  86.     public function getSurveyCampaign(): ?SurveyCampaign
  87.     {
  88.         return $this->surveyCampaign;
  89.     }
  90.     public function setSurveyCampaign(?SurveyCampaign $surveyCampaign): self
  91.     {
  92.         $this->surveyCampaign $surveyCampaign;
  93.         return $this;
  94.     }
  95.     public function getCompany(): ?Company
  96.     {
  97.         return $this->company;
  98.     }
  99.     public function setCompany(?Company $company): self
  100.     {
  101.         $this->company $company;
  102.         return $this;
  103.     }
  104.     public function getUser(): ?User
  105.     {
  106.         return $this->user;
  107.     }
  108.     public function setUser(?User $user): self
  109.     {
  110.         $this->user $user;
  111.         return $this;
  112.     }
  113.     public function getFormQuestion(): ?SurveyFormQuestion
  114.     {
  115.         return $this->formQuestion;
  116.     }
  117.     public function setFormQuestion(?SurveyFormQuestion $formQuestion): self
  118.     {
  119.         $this->formQuestion $formQuestion;
  120.         return $this;
  121.     }
  122.     public function getCreatedAt(): DateTime
  123.     {
  124.         return $this->createdAt;
  125.     }
  126.     public function setCreatedAt(DateTime $createdAt): self
  127.     {
  128.         $this->createdAt $createdAt;
  129.         return $this;
  130.     }
  131.     public function getUpdatedAt(): ?DateTime
  132.     {
  133.         return $this->updatedAt;
  134.     }
  135.     public function setUpdatedAt(?DateTime $updatedAt): self
  136.     {
  137.         $this->updatedAt $updatedAt;
  138.         return $this;
  139.     }
  140. }