<?php
namespace App\Entity;
use App\Repository\LMSExerciseRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=LMSExerciseRepository::class)
*/
class LMSExercise
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255)
*/
private $title;
/**
* @ORM\ManyToMany(targetEntity=LMSContent::class, inversedBy="lMSExercises")
* @ORM\JoinColumn(nullable=true)
*/
private $lmsContents;
/**
* @ORM\OneToMany(targetEntity=LMSAsk::class, mappedBy="exercise")
*/
private $lMSAsks;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $updatedAt;
/**
* @ORM\Column(type="float")
*/
private $duration;
/**
* @ORM\OneToMany(targetEntity=LMSAnswerUser::class, mappedBy="exercise")
*/
private $lMSAnswerUsers; /** * @ORM\ManyToOne(targetEntity=LMSSequence::class, inversedBy="lmsExercises") */ private $lMSSequence;
public function __construct()
{
$this->lMSAsks = new ArrayCollection();
$this->lmsContents = new ArrayCollection();
$this->lMSAnswerUsers = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getTitle(): ?string
{
return $this->title;
}
public function setTitle(string $title): self
{
$this->title = $title;
return $this;
}
/**
* @return Collection<int, LMSContent>
*/
public function getLmsContent(): Collection
{
return $this->lmsContent;
}
public function addLmsContent(LMSContent $lmsContent): self
{
if (!$this->lmsContents->contains($lmsContent)) {
$this->lmsContents[] = $lmsContent;
}
return $this;
}
public function removeLmsContent(LMSContent $lmsContent): self
{
$this->lmsContent->removeElement($lmsContent);
return $this;
}
/**
* @return Collection<int, LMSAsk>
*/
public function getLMSAsks(): Collection
{
return $this->lMSAsks;
}
public function addLMSAsk(LMSAsk $lMSAsk): self
{
if (!$this->lMSAsks->contains($lMSAsk)) {
$this->lMSAsks[] = $lMSAsk;
$lMSAsk->setExercise($this);
}
return $this;
}
public function removeLMSAsk(LMSAsk $lMSAsk): self
{
if ($this->lMSAsks->removeElement($lMSAsk)) {
// set the owning side to null (unless already changed)
if ($lMSAsk->getExercice() === $this) {
$lMSAsk->setExercice(null);
}
}
return $this;
}
public function getUpdatedAt(): ?\DateTimeInterface
{
return $this->updatedAt;
}
public function setUpdatedAt(?\DateTimeInterface $updatedAt): self
{
$this->updatedAt = $updatedAt;
return $this;
}
public function getDuration(): ?float
{
return $this->duration;
}
public function setDuration(float $duration): self
{
$this->duration = $duration;
return $this;
}
/**
* @return Collection<int, LMSAnswerUser>
*/
public function getLMSAnswerUsers(): Collection
{
return $this->lMSAnswerUsers;
}
public function addLMSAnswerUser(LMSAnswerUser $lMSAnswerUser): self
{
if (!$this->lMSAnswerUsers->contains($lMSAnswerUser)) {
$this->lMSAnswerUsers[] = $lMSAnswerUser;
$lMSAnswerUser->setExercise($this);
}
return $this;
}
public function removeLMSAnswerUser(LMSAnswerUser $lMSAnswerUser): self
{
if ($this->lMSAnswerUsers->removeElement($lMSAnswerUser)) {
// set the owning side to null (unless already changed)
if ($lMSAnswerUser->getExercise() === $this) {
$lMSAnswerUser->setExercise(null);
}
}
return $this;
} public function getLMSSequence(): ?LMSSequence { return $this->lMSSequence; } public function setLMSSequence(?LMSSequence $lMSSequence): self { $this->lMSSequence = $lMSSequence; return $this; }
}