1 | <?php |
||
16 | class SurveyQuestion |
||
17 | { |
||
18 | use ORMBehaviors\Timestampable\Timestampable; |
||
19 | |||
20 | /** |
||
21 | * @var int |
||
22 | * |
||
23 | * @ORM\Column(type="integer") |
||
24 | * @ORM\Id |
||
25 | * @ORM\GeneratedValue(strategy="AUTO") |
||
26 | * @Groups({"group2", "group3"}) |
||
27 | */ |
||
28 | private $id; |
||
29 | |||
30 | /** |
||
31 | * @var string |
||
32 | * @Assert\NotBlank() |
||
33 | * @Assert\Type("string") |
||
34 | * @Assert\Length( |
||
35 | * max = 500 |
||
36 | * ) |
||
37 | * @ORM\Column(type="string") |
||
38 | * @Groups({"group2", "group3"}) |
||
39 | */ |
||
40 | private $title; |
||
41 | |||
42 | /** |
||
43 | * @var SurveyType |
||
44 | * @Assert\Type("object") |
||
45 | * @Assert\Valid |
||
46 | * @ORM\ManyToOne(targetEntity="SurveyType", inversedBy="questions") |
||
47 | */ |
||
48 | private $surveyType; |
||
49 | |||
50 | /** |
||
51 | * @var ArrayCollection[Survey] |
||
52 | * @ORM\ManyToMany(targetEntity="Survey", inversedBy="questions") |
||
53 | */ |
||
54 | private $surveys; |
||
55 | |||
56 | /** |
||
57 | * @var ArrayCollection[SurveyAnswer] |
||
58 | * @ORM\OneToMany(targetEntity="SurveyAnswer", mappedBy="question") |
||
59 | */ |
||
60 | private $answers; |
||
61 | |||
62 | public function __construct() |
||
67 | |||
68 | /** |
||
69 | * Get id. |
||
70 | * |
||
71 | * @return int |
||
72 | */ |
||
73 | 1 | public function getId() |
|
77 | |||
78 | /** |
||
79 | * Set title. |
||
80 | * |
||
81 | * @param string $title |
||
82 | * |
||
83 | * @return SurveyQuestion |
||
84 | */ |
||
85 | public function setTitle($title) |
||
91 | |||
92 | /** |
||
93 | * Get title. |
||
94 | * |
||
95 | * @return string |
||
96 | */ |
||
97 | 3 | public function getTitle() |
|
101 | |||
102 | /** |
||
103 | * Set type. |
||
104 | * |
||
105 | * @param SurveyType $type |
||
106 | * |
||
107 | * @return SurveyQuestion |
||
108 | */ |
||
109 | public function setSurveyType(SurveyType $type) |
||
115 | |||
116 | /** |
||
117 | * Get type. |
||
118 | * |
||
119 | * @return SurveyType |
||
120 | */ |
||
121 | public function getSurveyType() |
||
125 | |||
126 | /** |
||
127 | * @param Survey $survey |
||
128 | * |
||
129 | * @return SurveyQuestion |
||
130 | */ |
||
131 | 1 | public function addSurvey(Survey $survey) |
|
140 | |||
141 | /** |
||
142 | * Get Surveys. |
||
143 | * |
||
144 | * @return ArrayCollection |
||
145 | */ |
||
146 | public function getSurveys() |
||
150 | |||
151 | /** |
||
152 | * Get Answers. |
||
153 | * |
||
154 | * @return ArrayCollection |
||
155 | */ |
||
156 | public function getAnswers() |
||
160 | } |
||
161 |