src/Entity/Answere.php line 14
<?phpnamespace App\Entity;use ApiPlatform\Metadata\ApiResource;use App\Repository\AnswereRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\DBAL\Types\Types;use Doctrine\ORM\Mapping as ORM;#[ORM\Entity(repositoryClass: AnswereRepository::class)]#[ApiResource]class Answere{#[ORM\Id]#[ORM\GeneratedValue]#[ORM\Column]private ?int $id = null;#[ORM\Column(type: Types::TEXT)]private ?string $text = null;#[ORM\Column]private ?bool $isRight = null;#[ORM\ManyToOne(inversedBy: 'answeres')]private ?Question $question = null;#[ORM\OneToMany(mappedBy: 'answer', targetEntity: GivenAnswere::class)]private Collection $givenAnsweres;public function __construct(){$this->givenAnsweres = new ArrayCollection();}public function getId(): ?int{return $this->id;}public function getText(): ?string{return $this->text;}public function setText(string $text): self{$this->text = $text;return $this;}public function isIsRight(): ?bool{return $this->isRight;}public function setIsRight(bool $isRight): self{$this->isRight = $isRight;return $this;}public function getQuestion(): ?Question{return $this->question;}public function setQuestion(?Question $question): self{$this->question = $question;return $this;}/*** @return Collection<int, GivenAnswere>*/public function getGivenAnsweres(): Collection{return $this->givenAnsweres;}public function addGivenAnswere(GivenAnswere $givenAnswere): self{if (!$this->givenAnsweres->contains($givenAnswere)) {$this->givenAnsweres->add($givenAnswere);$givenAnswere->setAnswer($this);}return $this;}public function removeGivenAnswere(GivenAnswere $givenAnswere): self{if ($this->givenAnsweres->removeElement($givenAnswere)) {// set the owning side to null (unless already changed)if ($givenAnswere->getAnswer() === $this) {$givenAnswere->setAnswer(null);}}return $this;}}