src/Entity/Answer.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\AnswerRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. /**
  6.  * @ORM\Entity(repositoryClass=AnswerRepository::class)
  7.  */
  8. class Answer
  9. {
  10.     /**
  11.      * @ORM\Id
  12.      * @ORM\GeneratedValue
  13.      * @ORM\Column(type="integer")
  14.      */
  15.     private $id;
  16.     /**
  17.      * @ORM\OneToOne(targetEntity=Questions::class, inversedBy="answer", cascade={"persist", "remove"})
  18.      */
  19.     private $question;
  20.     /**
  21.      * @ORM\Column(type="datetime", nullable=true)
  22.      */
  23.     private $createdAt;
  24.     /**
  25.      * @ORM\Column(type="datetime", nullable=true)
  26.      */
  27.     private $updatedAt;
  28.     /**
  29.      * @ORM\Column(type="text", nullable=true)
  30.      */
  31.     private $answer;
  32.     /**
  33.      * @ORM\ManyToOne(targetEntity=Questions::class, inversedBy="answers")
  34.      */
  35.     private $qstn;
  36.     /**
  37.      * @ORM\ManyToOne(targetEntity=User::class, inversedBy="answers")
  38.      */
  39.     private $user;
  40.     public function getId(): ?int
  41.     {
  42.         return $this->id;
  43.     }
  44.     public function getQuestion(): ?Questions
  45.     {
  46.         return $this->question;
  47.     }
  48.     public function setQuestion(?Questions $question): self
  49.     {
  50.         $this->question $question;
  51.         return $this;
  52.     }
  53.     public function getCreatedAt(): ?\DateTimeInterface
  54.     {
  55.         return $this->createdAt;
  56.     }
  57.     public function setCreatedAt(?\DateTimeInterface $createdAt): self
  58.     {
  59.         $this->createdAt $createdAt;
  60.         return $this;
  61.     }
  62.     public function getUpdatedAt(): ?\DateTimeInterface
  63.     {
  64.         return $this->updatedAt;
  65.     }
  66.     public function setUpdatedAt(?\DateTimeInterface $updatedAt): self
  67.     {
  68.         $this->updatedAt $updatedAt;
  69.         return $this;
  70.     }
  71.     public function getAnswer(): ?string
  72.     {
  73.         return $this->answer;
  74.     }
  75.     public function setAnswer(?string $answer): self
  76.     {
  77.         $this->answer $answer;
  78.         return $this;
  79.     }
  80.     public function getQstn(): ?Questions
  81.     {
  82.         return $this->qstn;
  83.     }
  84.     public function setQstn(?Questions $qstn): self
  85.     {
  86.         $this->qstn $qstn;
  87.         return $this;
  88.     }
  89.     public function getUser(): ?User
  90.     {
  91.         return $this->user;
  92.     }
  93.     public function setUser(?User $user): self
  94.     {
  95.         $this->user $user;
  96.         return $this;
  97.     }
  98. }