src/Entity/Survey/SurveyResult.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Survey;
  3. use App\Entity\PrimaryIdTrait;
  4. use App\Entity\User\User;
  5. use App\Repository\Survey\SurveyResultRepository;
  6. use Doctrine\Common\Collections\ArrayCollection;
  7. use Doctrine\Common\Collections\Collection;
  8. use Doctrine\ORM\Mapping as ORM;
  9. use Gedmo\Timestampable\Traits\TimestampableEntity;
  10. use Symfony\Component\Serializer\Annotation\Groups;
  11. #[ORM\Entity(repositoryClassSurveyResultRepository::class)]
  12. class SurveyResult
  13. {
  14.     public const ROUTE_NAME_CREATE null;
  15.     public const ROUTE_NAME_EDIT null;
  16.     public const ROUTE_NAME_DETAIL 'SURVEY_RESULT_DETAIL';
  17.     public const ROUTE_NAME_DELETE 'SURVEY_RESULT_DELETE';
  18.     use PrimaryIdTrait;
  19.     use TimestampableEntity;
  20.     #[ORM\Column(type'string')]
  21.     private string $userIp;
  22.     #[ORM\Column(type'string')]
  23.     private string $userAgent;
  24.     /**
  25.      * @var Survey
  26.      */
  27.     #[ORM\ManyToOne(targetEntity'App\Entity\Survey\Survey'inversedBy'surveyResult')]
  28.     private $survey;
  29.     #[ORM\OneToMany(targetEntity'App\Entity\Survey\SurveyResultData'mappedBy'surveyResult'cascade: ['remove'])]
  30.     #[Groups(['test'])]
  31.     public $surveyResultData;
  32.     #[ORM\ManyToOne(targetEntity'App\Entity\User\User'inversedBy'surveyResult')]
  33.     private ?User $user;
  34.     #[ORM\Column(type'string'nullabletrue)]
  35.     private ?string $email;
  36.     #[ORM\Column(type'integer'nullabletrue)]
  37.     protected ?int $travelTime;
  38.     #[ORM\Column(type'float'nullabletrue)]
  39.     protected ?float $progress;
  40.     public function __construct()
  41.     {
  42.         $this->surveyResultData = new ArrayCollection();
  43.     }
  44.     public function getUserIp(): string
  45.     {
  46.         return $this->userIp;
  47.     }
  48.     public function setUserIp(string $userIp): void
  49.     {
  50.         $this->userIp $userIp;
  51.     }
  52.     public function getUserAgent(): string
  53.     {
  54.         return $this->userAgent;
  55.     }
  56.     public function setUserAgent(string $userAgent): void
  57.     {
  58.         $this->userAgent $userAgent;
  59.     }
  60.     /**
  61.      * @return Survey
  62.      */
  63.     public function getSurvey(): ?Survey
  64.     {
  65.         return $this->survey;
  66.     }
  67.     /**
  68.      * @param Survey $survey
  69.      */
  70.     public function setSurvey(Survey $survey): void
  71.     {
  72.         $this->survey $survey;
  73.     }
  74.     /**
  75.      * @return Collection|SurveyResultData[]
  76.      */
  77.     public function getSurveyResultData(): Collection
  78.     {
  79.         return $this->surveyResultData;
  80.     }
  81.     /**
  82.      * @return User
  83.      */
  84.     public function getUser(): ?User
  85.     {
  86.         return $this->user;
  87.     }
  88.     /**
  89.      * @param User $user
  90.      */
  91.     public function setUser(?User $user): void
  92.     {
  93.         $this->user $user;
  94.     }
  95.     public function getEmail(): ?string
  96.     {
  97.         return $this->email;
  98.     }
  99.     public function setEmail(?string $email): void
  100.     {
  101.         $this->email $email;
  102.     }
  103.     public function getTravelTime(): ?int
  104.     {
  105.         return $this->travelTime;
  106.     }
  107.     public function setTravelTime(?int $travelTime): void
  108.     {
  109.         $this->travelTime $travelTime;
  110.     }
  111.     public function getProgress(): ?float
  112.     {
  113.         return $this->progress;
  114.     }
  115.     public function setProgress(?float $progress): void
  116.     {
  117.         $this->progress $progress;
  118.     }
  119. }