| 1 | <?php |
||
| 15 | class SurveyAnswer |
||
| 16 | { |
||
| 17 | use ORMBehaviors\Timestampable\Timestampable; |
||
| 18 | |||
| 19 | /** |
||
| 20 | * @var int |
||
| 21 | * |
||
| 22 | * @ORM\Column(type="integer") |
||
| 23 | * @ORM\Id |
||
| 24 | * @ORM\GeneratedValue(strategy="AUTO") |
||
| 25 | */ |
||
| 26 | private $id; |
||
| 27 | |||
| 28 | /** |
||
| 29 | * @var string |
||
| 30 | * @Assert\Type("string") |
||
| 31 | * @ORM\Column(type="string", nullable=true) |
||
| 32 | */ |
||
| 33 | private $type; |
||
| 34 | |||
| 35 | /** |
||
| 36 | * @var SurveyQuestion |
||
| 37 | * @Assert\Type("object") |
||
| 38 | * @Assert\Valid |
||
| 39 | * @ORM\ManyToOne(targetEntity="SurveyQuestion", inversedBy="answers") |
||
| 40 | * @Groups({"group2"}) |
||
| 41 | */ |
||
| 42 | private $question; |
||
| 43 | |||
| 44 | /** |
||
| 45 | * @var Survey |
||
| 46 | * @Assert\Type("object") |
||
| 47 | * @Assert\Valid |
||
| 48 | * @ORM\ManyToOne(targetEntity="Survey", inversedBy="answers") |
||
| 49 | */ |
||
| 50 | private $survey; |
||
| 51 | |||
| 52 | /** |
||
| 53 | * @var string |
||
| 54 | * @Assert\NotBlank() |
||
| 55 | * @Assert\Type("string") |
||
| 56 | * @Assert\Length( |
||
| 57 | * max = 1000 |
||
| 58 | * ) |
||
| 59 | * @ORM\Column(name="body", type="text") |
||
| 60 | * @Groups({"group2"}) |
||
| 61 | */ |
||
| 62 | private $content; |
||
| 63 | |||
| 64 | /** |
||
| 65 | * Get id. |
||
| 66 | * |
||
| 67 | * @return int |
||
| 68 | */ |
||
| 69 | public function getId() |
||
| 73 | |||
| 74 | /** |
||
| 75 | * Set type. |
||
| 76 | * |
||
| 77 | * @param string $type |
||
| 78 | * |
||
| 79 | * @return SurveyAnswer |
||
| 80 | */ |
||
| 81 | public function setType($type) |
||
| 87 | |||
| 88 | /** |
||
| 89 | * Get type. |
||
| 90 | * |
||
| 91 | * @return string |
||
| 92 | */ |
||
| 93 | public function getType() |
||
| 97 | |||
| 98 | /** |
||
| 99 | * Set survey question. |
||
| 100 | * |
||
| 101 | * @param SurveyQuestion $question |
||
| 102 | * |
||
| 103 | * @return SurveyAnswer |
||
| 104 | */ |
||
| 105 | 1 | public function setQuestion(SurveyQuestion $question) |
|
| 111 | |||
| 112 | /** |
||
| 113 | * Get survey question. |
||
| 114 | * |
||
| 115 | * @return SurveyQuestion |
||
| 116 | */ |
||
| 117 | 1 | public function getQuestion() |
|
| 121 | |||
| 122 | /** |
||
| 123 | * Set survey. |
||
| 124 | * |
||
| 125 | * @param Survey $survey |
||
| 126 | * |
||
| 127 | * @return SurveyAnswer |
||
| 128 | */ |
||
| 129 | 1 | public function setSurvey(Survey $survey) |
|
| 135 | |||
| 136 | /** |
||
| 137 | * Get survey. |
||
| 138 | * |
||
| 139 | * @return Survey |
||
| 140 | */ |
||
| 141 | public function getSurvey() |
||
| 145 | |||
| 146 | /** |
||
| 147 | * Set content. |
||
| 148 | * |
||
| 149 | * @param string $content |
||
| 150 | * |
||
| 151 | * @return SurveyAnswer |
||
| 152 | */ |
||
| 153 | 1 | public function setContent($content) |
|
| 159 | |||
| 160 | /** |
||
| 161 | * Get content. |
||
| 162 | * |
||
| 163 | * @return string |
||
| 164 | */ |
||
| 165 | 1 | public function getContent() |
|
| 169 | } |
||
| 170 |