Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- namespace AppBundle\DTO;
- use AppBundle\Model\AnswerInterface;
- use AppBundle\Model\CategoryInterface;
- use Symfony\Component\Validator\Constraints as Assert;
- /**
- * Class QuestionDTO
- * @package AppBundle\DTO
- */
- class QuestionDTO implements SymfonyFormDTO
- {
- /**
- * @var text
- * @Assert\NotBlank()
- */
- protected $question;
- /**
- * @var CategoryInterface
- */
- protected $category;
- /**
- * @var bool
- */
- protected $difficulty;
- /**
- * @var bool
- */
- protected $default;
- /**
- * @var bool
- */
- protected $status;
- /**
- * @var array
- */
- protected $answers;
- /**
- * Get Class name.
- * @return string
- */
- public function getDataClass()
- {
- return self::class;
- }
- /**
- * {@inheritdoc}
- */
- function jsonSerialize()
- {
- return [
- $this->question,
- $this->difficulty,
- $this->status,
- $this->default
- ];
- }
- /**
- * @return string
- */
- public function getQuestion():string
- {
- return (string) $this->question;
- }
- /**
- * @param string|null $question
- * @return QuestionDTO
- */
- public function setQuestion(string $question= null):QuestionDTO
- {
- $this->question = $question;
- return $this;
- }
- /**
- * @return CategoryInterface
- */
- public function getCategory()
- {
- return $this->category;
- }
- /**
- * @param CategoryInterface $category
- */
- public function setCategory($category)
- {
- $this->category = $category;
- }
- /**
- * @return bool
- */
- public function isDifficulty()
- {
- return $this->difficulty;
- }
- /**
- * @param bool $difficulty
- */
- public function setDifficulty($difficulty)
- {
- $this->difficulty = $difficulty;
- }
- /**
- * @return bool
- */
- public function isDefault()
- {
- return $this->default;
- }
- /**
- * @param bool $default
- */
- public function setDefault($default)
- {
- $this->default = $default;
- }
- /**
- * @return bool
- */
- public function isStatus()
- {
- return $this->status;
- }
- /**
- * @param bool $status
- */
- public function setStatus($status)
- {
- $this->status = $status;
- }
- /**
- * @return array
- */
- public function getAnwers(): array
- {
- return $this->anwers;
- }
- /**
- * @param array $activities
- *
- * @return QuestionDTO
- */
- public function setAnwers(array $activities = null): QuestionDTO
- {
- $this->anwers = $activities;
- return $this;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement