<?php
namespace App\Entity\Survey;
use App\Entity\PrimaryIdTrait;
use App\Repository\Survey\QuestionAnswerRepository;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Timestampable\Traits\TimestampableEntity;
use Symfony\Component\Serializer\Annotation\Groups;
#[ORM\Entity(repositoryClass: QuestionAnswerRepository::class)]
class QuestionAnswer
{
use PrimaryIdTrait;
use TimestampableEntity;
/**
* @var Question
*/
#[ORM\ManyToOne(targetEntity: 'App\Entity\Survey\Question', inversedBy: 'questionAnswer')]
private $question;
/**
* @var Answer
*/
#[ORM\ManyToOne(targetEntity: 'App\Entity\Survey\Answer', inversedBy: 'questionAnswer', cascade: ['persist', 'remove'])]
#[Groups(['survey', 'childrenQuestions'])]
private $answer;
#[ORM\Column(type: 'integer')]
#[Groups(['survey', 'childrenQuestions'])]
private int $sort;
/**
* @return Question
*/
public function getQuestion(): ?Question
{
return $this->question;
}
/**
* @param Question $question
*/
public function setQuestion(Question $question): void
{
$this->question = $question;
}
/**
* @return Answer
*/
public function getAnswer(): ?Answer
{
return $this->answer;
}
/**
* @param Answer $answer
*/
public function setAnswer(Answer $answer): void
{
$this->answer = $answer;
}
public function getSort(): int
{
return $this->sort;
}
public function setSort(int $sort): void
{
$this->sort = $sort;
}
}