src/Entity/LMSExercise.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\LMSExerciseRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity(repositoryClass=LMSExerciseRepository::class)
  9.  */
  10. class LMSExercise
  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 $title;
  22.     
  23.     /**
  24.      * @ORM\ManyToMany(targetEntity=LMSContent::class, inversedBy="lMSExercises")
  25.      * @ORM\JoinColumn(nullable=true)
  26.      */
  27.     private $lmsContents;
  28.     /**
  29.      * @ORM\OneToMany(targetEntity=LMSAsk::class, mappedBy="exercise")
  30.      */
  31.     private $lMSAsks;
  32.     /**
  33.      * @ORM\Column(type="datetime", nullable=true)
  34.      */
  35.     private $updatedAt;
  36.     /**
  37.      * @ORM\Column(type="float")
  38.      */
  39.     private $duration;
  40.     /**
  41.      * @ORM\OneToMany(targetEntity=LMSAnswerUser::class, mappedBy="exercise")
  42.      */
  43.     private $lMSAnswerUsers;
  44.     /**
  45.      * @ORM\ManyToOne(targetEntity=LMSSequence::class, inversedBy="lmsExercises")
  46.      */
  47.     private $lMSSequence;
  48.     public function __construct()
  49.     {
  50.         $this->lMSAsks = new ArrayCollection();
  51.         $this->lmsContents = new ArrayCollection();
  52.         $this->lMSAnswerUsers = new ArrayCollection();
  53.     }
  54.     public function getId(): ?int
  55.     {
  56.         return $this->id;
  57.     }
  58.     public function getTitle(): ?string
  59.     {
  60.         return $this->title;
  61.     }
  62.     public function setTitle(string $title): self
  63.     {
  64.         $this->title $title;
  65.         return $this;
  66.     }
  67.     
  68.     /**
  69.      * @return Collection<int, LMSContent>
  70.      */
  71.     public function getLmsContent(): Collection
  72.     {
  73.         return $this->lmsContent;
  74.     }
  75.     public function addLmsContent(LMSContent $lmsContent): self
  76.     {
  77.         if (!$this->lmsContents->contains($lmsContent)) {
  78.             $this->lmsContents[] = $lmsContent;
  79.         }
  80.         return $this;
  81.     }
  82.     public function removeLmsContent(LMSContent $lmsContent): self
  83.     {
  84.         $this->lmsContent->removeElement($lmsContent);
  85.         return $this;
  86.     }
  87.     /**
  88.      * @return Collection<int, LMSAsk>
  89.      */
  90.     public function getLMSAsks(): Collection
  91.     {
  92.         return $this->lMSAsks;
  93.     }
  94.     public function addLMSAsk(LMSAsk $lMSAsk): self
  95.     {
  96.         if (!$this->lMSAsks->contains($lMSAsk)) {
  97.             $this->lMSAsks[] = $lMSAsk;
  98.             $lMSAsk->setExercise($this);
  99.         }
  100.         return $this;
  101.     }
  102.     public function removeLMSAsk(LMSAsk $lMSAsk): self
  103.     {
  104.         if ($this->lMSAsks->removeElement($lMSAsk)) {
  105.             // set the owning side to null (unless already changed)
  106.             if ($lMSAsk->getExercice() === $this) {
  107.                 $lMSAsk->setExercice(null);
  108.             }
  109.         }
  110.         return $this;
  111.     }
  112.     public function getUpdatedAt(): ?\DateTimeInterface
  113.     {
  114.         return $this->updatedAt;
  115.     }
  116.     public function setUpdatedAt(?\DateTimeInterface $updatedAt): self
  117.     {
  118.         $this->updatedAt $updatedAt;
  119.         return $this;
  120.     }
  121.     public function getDuration(): ?float
  122.     {
  123.         return $this->duration;
  124.     }
  125.     public function setDuration(float $duration): self
  126.     {
  127.         $this->duration $duration;
  128.         return $this;
  129.     }
  130.     /**
  131.      * @return Collection<int, LMSAnswerUser>
  132.      */
  133.     public function getLMSAnswerUsers(): Collection
  134.     {
  135.         return $this->lMSAnswerUsers;
  136.     }
  137.     public function addLMSAnswerUser(LMSAnswerUser $lMSAnswerUser): self
  138.     {
  139.         if (!$this->lMSAnswerUsers->contains($lMSAnswerUser)) {
  140.             $this->lMSAnswerUsers[] = $lMSAnswerUser;
  141.             $lMSAnswerUser->setExercise($this);
  142.         }
  143.         return $this;
  144.     }
  145.     public function removeLMSAnswerUser(LMSAnswerUser $lMSAnswerUser): self
  146.     {
  147.         if ($this->lMSAnswerUsers->removeElement($lMSAnswerUser)) {
  148.             // set the owning side to null (unless already changed)
  149.             if ($lMSAnswerUser->getExercise() === $this) {
  150.                 $lMSAnswerUser->setExercise(null);
  151.             }
  152.         }
  153.         return $this;
  154.     }
  155.     public function getLMSSequence(): ?LMSSequence
  156.     {
  157.         return $this->lMSSequence;
  158.     }
  159.     public function setLMSSequence(?LMSSequence $lMSSequence): self
  160.     {
  161.         $this->lMSSequence $lMSSequence;
  162.         return $this;
  163.     }
  164. }