| Total Complexity | 6 |
| Total Lines | 64 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 15 | #[ORM\Table(name: 'c_quiz_question_option')] |
||
| 16 | #[ORM\Entity] |
||
| 17 | class CQuizQuestionOption |
||
| 18 | { |
||
| 19 | #[ORM\Column(name: 'iid', type: 'integer')] |
||
| 20 | #[ORM\Id] |
||
| 21 | #[ORM\GeneratedValue] |
||
| 22 | protected ?int $iid = null; |
||
| 23 | |||
| 24 | #[ORM\Column(name: 'title', type: 'string', length: 255, nullable: false)] |
||
| 25 | protected string $title; |
||
| 26 | |||
| 27 | #[ORM\Column(name: 'position', type: 'integer', nullable: false)] |
||
| 28 | protected int $position; |
||
| 29 | |||
| 30 | #[Assert\NotBlank] |
||
| 31 | #[ORM\ManyToOne(targetEntity: CQuizQuestion::class, cascade: ['persist'], inversedBy: 'options')] |
||
| 32 | #[ORM\JoinColumn(name: 'question_id', referencedColumnName: 'iid', onDelete: 'CASCADE')] |
||
| 33 | protected CQuizQuestion $question; |
||
| 34 | |||
| 35 | public function setTitle(string $title): self |
||
| 36 | { |
||
| 37 | $this->title = $title; |
||
| 38 | |||
| 39 | return $this; |
||
| 40 | } |
||
| 41 | |||
| 42 | /** |
||
| 43 | * Get name. |
||
| 44 | * |
||
| 45 | * @return string |
||
| 46 | */ |
||
| 47 | public function getTitle() |
||
| 48 | { |
||
| 49 | return $this->title; |
||
| 50 | } |
||
| 51 | |||
| 52 | public function setPosition(int $position): self |
||
| 53 | { |
||
| 54 | $this->position = $position; |
||
| 55 | |||
| 56 | return $this; |
||
| 57 | } |
||
| 58 | |||
| 59 | /** |
||
| 60 | * Get position. |
||
| 61 | * |
||
| 62 | * @return int |
||
| 63 | */ |
||
| 64 | public function getPosition() |
||
| 65 | { |
||
| 66 | return $this->position; |
||
| 67 | } |
||
| 68 | |||
| 69 | public function getQuestion(): CQuizQuestion |
||
| 72 | } |
||
| 73 | |||
| 74 | public function setQuestion(CQuizQuestion $question): self |
||
| 79 | } |
||
| 80 | } |
||
| 81 |