src/Entity/Gos/Uniqskills/UserAnswer.php line 16

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Gos\Uniqskills;
  3. use App\Entity\Gos\User;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use Gedmo\Mapping\Annotation as Gedmo;
  8. /**
  9.  * @ORM\Table()
  10.  * @ORM\Entity(repositoryClass="App\Repository\Gos\Uniqskills\UserAnswerRepository")
  11.  * @ORM\HasLifecycleCallbacks
  12.  */
  13. class UserAnswer
  14. {
  15.     /**
  16.      * @var integer
  17.      *
  18.      * @ORM\Column(type="integer")
  19.      * @ORM\Id
  20.      * @ORM\GeneratedValue(strategy="AUTO")
  21.      */
  22.     private $id;
  23.     /**
  24.      * @ORM\Column(type="text", nullable=true)
  25.      */
  26.     private $textAnswer;
  27.     /**
  28.      * @ORM\Column(type="text", nullable=true)
  29.      */
  30.     private $expertComment;
  31.     /**
  32.      * @ORM\Column(type="boolean", nullable=true)
  33.      */
  34.     private $isOpenTrue;
  35.     /**
  36.      * @var \DateTime
  37.      *
  38.      * @ORM\Column(type="datetime", nullable=true)
  39.      */
  40.     private $createdAt;
  41.     /**
  42.      * @var \DateTime
  43.      *
  44.      * @ORM\Column(type="datetime", nullable=true)
  45.      */
  46.     private $updatedAt;
  47.     /**
  48.      * @ORM\OneToMany(targetEntity="UserAnswerFile", mappedBy="userAnswer")
  49.      */
  50.     private $userAnswerFile;
  51.     /**
  52.      * @ORM\ManyToOne(targetEntity="App\Entity\Gos\User", inversedBy="userAnswer")
  53.      * @ORM\JoinColumn()
  54.      */
  55.     private $user;
  56.     /**
  57.      * @ORM\ManyToOne(targetEntity="Question", inversedBy="userAnswer")
  58.      * @ORM\JoinColumn(name="question_id", referencedColumnName="id", onDelete="cascade")
  59.      */
  60.     private $question;
  61.     /**
  62.      * @ORM\ManyToOne(targetEntity="Answer", inversedBy="userAnswer")
  63.      * @ORM\JoinColumn(name="answer_id", referencedColumnName="id", onDelete="cascade")
  64.      */
  65.     private $answer;
  66.     /**
  67.      * @ORM\ManyToOne(targetEntity="Test", inversedBy="userAnswer")
  68.      * @ORM\JoinColumn()
  69.      */
  70.     private $test;
  71.     public function __construct()
  72.     {
  73.         $this->userAnswerFile = new ArrayCollection();
  74.     }
  75.     /** @ORM\PrePersist() */
  76.     public function prePersist()
  77.     {
  78.         $this->createdAt = new \DateTime();
  79.     }
  80.     /** @ORM\PreUpdate() */
  81.     public function preUpdate()
  82.     {
  83.         $this->updatedAt = new \DateTime();
  84.     }
  85.     public function __clone()
  86.     {
  87.         $this->id           null;
  88.         $this->updatedAt    null;
  89.     }
  90.     public function getId(): ?int
  91.     {
  92.         return $this->id;
  93.     }
  94.     public function getTextAnswer(): ?string
  95.     {
  96.         return $this->textAnswer;
  97.     }
  98.     public function setTextAnswer(?string $textAnswer): self
  99.     {
  100.         $this->textAnswer $textAnswer;
  101.         return $this;
  102.     }
  103.     public function getExpertComment(): ?string
  104.     {
  105.         return $this->expertComment;
  106.     }
  107.     public function setExpertComment(?string $expertComment): self
  108.     {
  109.         $this->expertComment $expertComment;
  110.         return $this;
  111.     }
  112.     public function getIsOpenTrue(): ?bool
  113.     {
  114.         return $this->isOpenTrue;
  115.     }
  116.     public function setIsOpenTrue(?bool $isOpenTrue): self
  117.     {
  118.         $this->isOpenTrue $isOpenTrue;
  119.         return $this;
  120.     }
  121.     public function getCreatedAt(): ?\DateTimeInterface
  122.     {
  123.         return $this->createdAt;
  124.     }
  125.     public function setCreatedAt(?\DateTimeInterface $createdAt): self
  126.     {
  127.         $this->createdAt $createdAt;
  128.         return $this;
  129.     }
  130.     public function getUpdatedAt(): ?\DateTimeInterface
  131.     {
  132.         return $this->updatedAt;
  133.     }
  134.     public function setUpdatedAt(?\DateTimeInterface $updatedAt): self
  135.     {
  136.         $this->updatedAt $updatedAt;
  137.         return $this;
  138.     }
  139.     /**
  140.      * @return Collection|UserAnswerFile[]
  141.      */
  142.     public function getUserAnswerFile(): Collection
  143.     {
  144.         return $this->userAnswerFile;
  145.     }
  146.     public function addUserAnswerFile(UserAnswerFile $userAnswerFile): self
  147.     {
  148.         if (!$this->userAnswerFile->contains($userAnswerFile)) {
  149.             $this->userAnswerFile[] = $userAnswerFile;
  150.             $userAnswerFile->setUserAnswer($this);
  151.         }
  152.         return $this;
  153.     }
  154.     public function removeUserAnswerFile(UserAnswerFile $userAnswerFile): self
  155.     {
  156.         if ($this->userAnswerFile->contains($userAnswerFile)) {
  157.             $this->userAnswerFile->removeElement($userAnswerFile);
  158.             // set the owning side to null (unless already changed)
  159.             if ($userAnswerFile->getUserAnswer() === $this) {
  160.                 $userAnswerFile->setUserAnswer(null);
  161.             }
  162.         }
  163.         return $this;
  164.     }
  165.     public function getUser(): ?User
  166.     {
  167.         return $this->user;
  168.     }
  169.     public function setUser(?User $user): self
  170.     {
  171.         $this->user $user;
  172.         return $this;
  173.     }
  174.     public function getQuestion(): ?Question
  175.     {
  176.         return $this->question;
  177.     }
  178.     public function setQuestion(?Question $question): self
  179.     {
  180.         $this->question $question;
  181.         return $this;
  182.     }
  183.     public function getAnswer(): ?Answer
  184.     {
  185.         return $this->answer;
  186.     }
  187.     public function setAnswer(?Answer $answer): self
  188.     {
  189.         $this->answer $answer;
  190.         return $this;
  191.     }
  192.     public function getTest(): ?Test
  193.     {
  194.         return $this->test;
  195.     }
  196.     public function setTest(?Test $test): self
  197.     {
  198.         $this->test $test;
  199.         return $this;
  200.     }
  201.     /* ****************************** GETTERS & SETTERS ******************************  */
  202. }