<?phpnamespace App\Entity\Survey;use App\Entity\PrimaryIdTrait;use App\Entity\User\User;use App\Repository\Survey\SurveyResultRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;use Gedmo\Timestampable\Traits\TimestampableEntity;use Symfony\Component\Serializer\Annotation\Groups;#[ORM\Entity(repositoryClass: SurveyResultRepository::class)]class SurveyResult{ public const ROUTE_NAME_CREATE = null; public const ROUTE_NAME_EDIT = null; public const ROUTE_NAME_DETAIL = 'SURVEY_RESULT_DETAIL'; public const ROUTE_NAME_DELETE = 'SURVEY_RESULT_DELETE'; use PrimaryIdTrait; use TimestampableEntity; #[ORM\Column(type: 'string')] private string $userIp; #[ORM\Column(type: 'string')] private string $userAgent; /** * @var Survey */ #[ORM\ManyToOne(targetEntity: 'App\Entity\Survey\Survey', inversedBy: 'surveyResult')] private $survey; #[ORM\OneToMany(targetEntity: 'App\Entity\Survey\SurveyResultData', mappedBy: 'surveyResult', cascade: ['remove'])] #[Groups(['test'])] public $surveyResultData; #[ORM\ManyToOne(targetEntity: 'App\Entity\User\User', inversedBy: 'surveyResult')] private ?User $user; #[ORM\Column(type: 'string', nullable: true)] private ?string $email; #[ORM\Column(type: 'integer', nullable: true)] protected ?int $travelTime; #[ORM\Column(type: 'float', nullable: true)] protected ?float $progress; public function __construct() { $this->surveyResultData = new ArrayCollection(); } public function getUserIp(): string { return $this->userIp; } public function setUserIp(string $userIp): void { $this->userIp = $userIp; } public function getUserAgent(): string { return $this->userAgent; } public function setUserAgent(string $userAgent): void { $this->userAgent = $userAgent; } /** * @return Survey */ public function getSurvey(): ?Survey { return $this->survey; } /** * @param Survey $survey */ public function setSurvey(Survey $survey): void { $this->survey = $survey; } /** * @return Collection|SurveyResultData[] */ public function getSurveyResultData(): Collection { return $this->surveyResultData; } /** * @return User */ public function getUser(): ?User { return $this->user; } /** * @param User $user */ public function setUser(?User $user): void { $this->user = $user; } public function getEmail(): ?string { return $this->email; } public function setEmail(?string $email): void { $this->email = $email; } public function getTravelTime(): ?int { return $this->travelTime; } public function setTravelTime(?int $travelTime): void { $this->travelTime = $travelTime; } public function getProgress(): ?float { return $this->progress; } public function setProgress(?float $progress): void { $this->progress = $progress; }}