src/Entity/LMSAsk.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\LMSAskRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity(repositoryClass=LMSAskRepository::class)
  9.  */
  10. class LMSAsk
  11. {
  12.     /**
  13.      * @ORM\Id
  14.      * @ORM\GeneratedValue
  15.      * @ORM\Column(type="integer")
  16.      */
  17.     private $id;
  18.     /**
  19.      * @ORM\Column(type="string", length=255)
  20.      */
  21.     private $ask;
  22.     /**
  23.      * @ORM\ManyToOne(targetEntity=LMSExercise::class, inversedBy="lMSAsks")
  24.      */
  25.     private $exercise;
  26.     /**
  27.      * @ORM\OneToMany(targetEntity=LMSAnswer::class, mappedBy="ask",cascade={"persist"})
  28.      */
  29.     private $lMSAnswers;
  30.     /**
  31.      * @ORM\ManyToOne(targetEntity=LMSSurvey::class, inversedBy="lMSAsks")
  32.      */
  33.     private $survey;
  34.     /**
  35.      * @ORM\Column(type="string", length=255, nullable=true)
  36.      */
  37.     private $type;
  38.     /**
  39.      * @ORM\OneToMany(targetEntity=LMSAnswerSurvey::class, mappedBy="ask",cascade={"persist"})
  40.      */
  41.     private $lMSAnswerSurveys;
  42.     /**
  43.      * @ORM\Column(type="string", length=255, nullable=true)
  44.      */
  45.     private $choice;
  46.     /**
  47.      * @ORM\OneToMany(targetEntity=LMSFreeAnswerSurvey::class, mappedBy="ask")
  48.      */
  49.     private $lMSFreeAnswerSurveys;
  50.     public function __construct()
  51.     {
  52.         $this->lMSAnswers = new ArrayCollection();
  53.         $this->lMSAnswerSurveys = new ArrayCollection();
  54.         $this->lMSFreeAnswerSurveys = new ArrayCollection();
  55.     }
  56.     public function getId(): ?int
  57.     {
  58.         return $this->id;
  59.     }
  60.     public function getAsk(): ?string
  61.     {
  62.         return $this->ask;
  63.     }
  64.     public function setAsk(string $ask): self
  65.     {
  66.         $this->ask $ask;
  67.         return $this;
  68.     }
  69.     public function getExercise(): ?LMSExercise
  70.     {
  71.         return $this->exercise;
  72.     }
  73.     public function setExercise(?LMSExercise $exercise): self
  74.     {
  75.         $this->exercise $exercise;
  76.         return $this;
  77.     }
  78.     /**
  79.      * @return Collection<int, LMSAnswer>
  80.      */
  81.     public function getLMSAnswers(): Collection
  82.     {
  83.         return $this->lMSAnswers;
  84.     }
  85.     public function addLMSAnswer(LMSAnswer $lMSAnswer): self
  86.     {
  87.         if (!$this->lMSAnswers->contains($lMSAnswer)) {
  88.             $this->lMSAnswers[] = $lMSAnswer;
  89.             $lMSAnswer->setAsk($this);
  90.         }
  91.         return $this;
  92.     }
  93.     public function removeLMSAnswer(LMSAnswer $lMSAnswer): self
  94.     {
  95.         if ($this->lMSAnswers->removeElement($lMSAnswer)) {
  96.             // set the owning side to null (unless already changed)
  97.             if ($lMSAnswer->getAsk() === $this) {
  98.                 $lMSAnswer->setAsk(null);
  99.             }
  100.         }
  101.         return $this;
  102.     }
  103.     public function getSurvey(): ?LMSSurvey
  104.     {
  105.         return $this->survey;
  106.     }
  107.     public function setSurvey(?LMSSurvey $survey): self
  108.     {
  109.         $this->survey $survey;
  110.         return $this;
  111.     }
  112.     public function getType(): ?string
  113.     {
  114.         return $this->type;
  115.     }
  116.     public function setType(?string $type): self
  117.     {
  118.         $this->type $type;
  119.         return $this;
  120.     }
  121.     /**
  122.      * @return Collection<int, LMSAnswerSurvey>
  123.      */
  124.     public function getLMSAnswerSurveys(): Collection
  125.     {
  126.         return $this->lMSAnswerSurveys;
  127.     }
  128.     public function addLMSAnswerSurvey(LMSAnswerSurvey $lMSAnswerSurvey): self
  129.     {
  130.         if (!$this->lMSAnswerSurveys->contains($lMSAnswerSurvey)) {
  131.             $this->lMSAnswerSurveys[] = $lMSAnswerSurvey;
  132.             $lMSAnswerSurvey->setAsk($this);
  133.         }
  134.         return $this;
  135.     }
  136.     public function removeLMSAnswerSurvey(LMSAnswerSurvey $lMSAnswerSurvey): self
  137.     {
  138.         if ($this->lMSAnswerSurveys->removeElement($lMSAnswerSurvey)) {
  139.             // set the owning side to null (unless already changed)
  140.             if ($lMSAnswerSurvey->getAsk() === $this) {
  141.                 $lMSAnswerSurvey->setAsk(null);
  142.             }
  143.         }
  144.         return $this;
  145.     }
  146.     public function getChoice(): ?string
  147.     {
  148.         return $this->choice;
  149.     }
  150.     public function setChoice(?string $choice): self
  151.     {
  152.         $this->choice $choice;
  153.         return $this;
  154.     }
  155.     /**
  156.      * @return Collection<int, LMSFreeAnswerSurvey>
  157.      */
  158.     public function getLMSFreeAnswerSurveys(): Collection
  159.     {
  160.         return $this->lMSFreeAnswerSurveys;
  161.     }
  162.     public function addLMSFreeAnswerSurvey(LMSFreeAnswerSurvey $lMSFreeAnswerSurvey): self
  163.     {
  164.         if (!$this->lMSFreeAnswerSurveys->contains($lMSFreeAnswerSurvey)) {
  165.             $this->lMSFreeAnswerSurveys[] = $lMSFreeAnswerSurvey;
  166.             $lMSFreeAnswerSurvey->setAsk($this);
  167.         }
  168.         return $this;
  169.     }
  170.     public function removeLMSFreeAnswerSurvey(LMSFreeAnswerSurvey $lMSFreeAnswerSurvey): self
  171.     {
  172.         if ($this->lMSFreeAnswerSurveys->removeElement($lMSFreeAnswerSurvey)) {
  173.             // set the owning side to null (unless already changed)
  174.             if ($lMSFreeAnswerSurvey->getAsk() === $this) {
  175.                 $lMSFreeAnswerSurvey->setAsk(null);
  176.             }
  177.         }
  178.         return $this;
  179.     }
  180. }