src/Entity/DateTimeTypeAnswer.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use ApiPlatform\Core\Annotation\ApiProperty;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Symfony\Component\Serializer\Annotation\Groups;
  6. use Symfony\Component\Validator\Constraints as Assert;
  7. /**
  8.  * @ORM\Entity(repositoryClass="App\Repository\DateTimeTypeAnswerRepository")
  9.  */
  10. class DateTimeTypeAnswer
  11. {
  12.     /**
  13.      * @ORM\Id
  14.      * @ORM\GeneratedValue
  15.      * @ORM\Column(type="integer")
  16.      * @Groups({"pinpointCampaign:list","surveyContribution:read"})
  17.      */
  18.     private int $id;
  19.     /**
  20.      * @ORM\Column(type="simple_array")
  21.      * @ApiProperty(
  22.      *     attributes={
  23.      *         "jsonld_context"={
  24.      *             "@type"="http://www.w3.org/2001/XMLSchema#array",
  25.      *         }
  26.      *     }
  27.      * )
  28.      * @Groups({"pinpointCampaign:list"})
  29.      */
  30.     private $dateTime = [];
  31.     /**
  32.      * @ORM\Column(type="string", length=255, nullable=true)
  33.      * @Assert\Length(max=255)
  34.      * @Groups({"pinpointCampaign:list"})
  35.      */
  36.     public string $errorMessage;
  37.     /**
  38.      * @ORM\Column(type="string", length=50, nullable=true)
  39.      * @Assert\Length(max=50)
  40.      * @Groups({"pinpointCampaign:list"})
  41.      */
  42.     public string $dateFormat;
  43.     /**
  44.      * @var SurveyFormQuestion
  45.      *
  46.      * @ORM\OneToOne(targetEntity=SurveyFormQuestion::class, inversedBy="dateTimeTypeAnswer", cascade={"persist", "remove"})
  47.      */
  48.     private $formQuestion;
  49.     public function getId(): ?int
  50.     {
  51.         return $this->id;
  52.     }
  53.     public function getDateTime(): ?array
  54.     {
  55.         return $this->dateTime;
  56.     }
  57.     public function setDateTime(array $dateTime): self
  58.     {
  59.         $this->dateTime $dateTime;
  60.         return $this;
  61.     }
  62.     public function getErrorMessage(): ?string
  63.     {
  64.         return $this->errorMessage;
  65.     }
  66.     public function setErrorMessage(?string $errorMessage): self
  67.     {
  68.         $this->errorMessage $errorMessage;
  69.         return $this;
  70.     }
  71.     public function getDateFormat(): ?string
  72.     {
  73.         return $this->dateFormat;
  74.     }
  75.     public function setDateFormat(?string $dateFormat): self
  76.     {
  77.         $this->dateFormat $dateFormat;
  78.         return $this;
  79.     }
  80.     public function getFormQuestion(): ?SurveyFormQuestion
  81.     {
  82.         return $this->formQuestion;
  83.     }
  84.     public function setFormQuestion(?SurveyFormQuestion $formQuestion): self
  85.     {
  86.         $this->formQuestion $formQuestion;
  87.         return $this;
  88.     }
  89. }