src/Entity/Survey/SurveyQuestion.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Survey;
  3. use App\Entity\PrimaryIdTrait;
  4. use App\Repository\Survey\SurveyQuestionRepository;
  5. use Doctrine\ORM\Mapping as ORM;
  6. use Gedmo\Timestampable\Traits\TimestampableEntity;
  7. use Symfony\Component\Serializer\Annotation\Groups;
  8. #[ORM\Entity(repositoryClassSurveyQuestionRepository::class)]
  9. class SurveyQuestion
  10. {
  11.     use PrimaryIdTrait;
  12.     use TimestampableEntity;
  13.     /**
  14.      * @var Survey
  15.      */
  16.     #[ORM\ManyToOne(targetEntity'App\Entity\Survey\Survey'inversedBy'surveyQuestion')]
  17.     private $survey;
  18.     /**
  19.      * @var Question
  20.      */
  21.     #[ORM\ManyToOne(targetEntity'App\Entity\Survey\Question'inversedBy'surveyQuestion'cascade: ['persist''remove'])]
  22.     #[Groups(['survey'])]
  23.     private $question;
  24.     #[ORM\Column(type'integer')]
  25.     #[Groups(['survey'])]
  26.     private int $sort;
  27.     /**
  28.      * @return Survey
  29.      */
  30.     public function getSurvey(): ?Survey
  31.     {
  32.         return $this->survey;
  33.     }
  34.     /**
  35.      * @param Survey $survey
  36.      */
  37.     public function setSurvey(Survey $survey): void
  38.     {
  39.         $this->survey $survey;
  40.     }
  41.     /**
  42.      * @return Question
  43.      */
  44.     public function getQuestion(): ?Question
  45.     {
  46.         return $this->question;
  47.     }
  48.     /**
  49.      * @param Question $question
  50.      */
  51.     public function setQuestion(Question $question): void
  52.     {
  53.         $this->question $question;
  54.     }
  55.     public function getSort(): int
  56.     {
  57.         return $this->sort;
  58.     }
  59.     public function setSort(int $sort): void
  60.     {
  61.         $this->sort $sort;
  62.     }
  63. }