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