src/Entity/SatisfactionClientSurveyResponse.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\SatisfactionClientSurveyResponseRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassSatisfactionClientSurveyResponseRepository::class)]
  8. class SatisfactionClientSurveyResponse
  9. {
  10.     #[ORM\IdORM\GeneratedValueORM\Column]
  11.     private ?int $id null;
  12.     #[ORM\ManyToOne(targetEntitySatisfactionClientSurvey::class, inversedBy'responses')]
  13.     private SatisfactionClientSurvey $survey;
  14.     #[ORM\Column(type'datetime')]
  15.     private \DateTimeInterface $answeredAt;
  16.     #[ORM\OneToMany(mappedBy'surveyResponse'targetEntitySatisfactionClientAnswer::class, cascade: ['persist''remove'])]
  17.     private Collection $answers;
  18.     public function __construct()
  19.     {
  20.         $this->answeredAt = new \DateTime();
  21.         $this->answers = new ArrayCollection();
  22.     }
  23.     public function getId(): ?int
  24.     {
  25.         return $this->id;
  26.     }
  27.     public function setAnswersCollection $answers): SatisfactionClientSurveyResponse{
  28.         $this->answers $answers;
  29.         return $this;
  30.     }
  31.     public function getAnswers(): Collection
  32.     {
  33.         return $this->answers;
  34.     }
  35.     public function addAnswerSatisfactionClientAnswer $answer): SatisfactionClientSurveyResponse{
  36.         $this->answers->add($answer);
  37.         return $this;
  38.     }
  39.     public function setSurveySatisfactionClientSurvey $survey): SatisfactionClientSurveyResponse{
  40.         $this->survey $survey;
  41.         return $this;
  42.     }
  43.     public function getSurvey(): SatisfactionClientSurvey{
  44.         return $this->survey;
  45.     }
  46.     public function getAnsweredAt(): \DateTime{
  47.         return $this->answeredAt;
  48.     }
  49.     public function setAnsweredAt(\DateTime $answeredAt): SatisfactionClientSurveyResponse{
  50.         $this->answeredAt $answeredAt;
  51.         return $this;
  52.     }
  53. }