src/Entity/Message.php line 12

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace App\Entity;
  4. use Doctrine\ORM\Mapping as ORM;
  5. /**
  6.  * @ORM\Entity()
  7.  */
  8. class Message implements MessageInterface
  9. {
  10.     use ResourceTrait;
  11.     use TimestampableTrait;
  12.     /**
  13.      * @ORM\ManyToOne(targetEntity="App\Entity\Location", inversedBy="messages")
  14.      * @ORM\JoinColumn(name="location_id", nullable=true)
  15.      */
  16.     private ?LocationInterface $location null;
  17.     /**
  18.      * @ORM\Column(type="string", nullable=false)
  19.      */
  20.     private ?string $type null;
  21.     /**
  22.      * @ORM\Column(type="string", length=255, nullable=false)
  23.      */
  24.     private ?string $name null;
  25.     /**
  26.      * @ORM\Column(type="string", length=255, nullable=true)
  27.      */
  28.     private ?string $phoneNumber null;
  29.     /**
  30.      * @ORM\Column(type="string", length=255, nullable=false)
  31.      */
  32.     private ?string $email null;
  33.     /**
  34.      * @ORM\Column(type="text", nullable=false)
  35.      */
  36.     private ?string $message null;
  37.     /**
  38.      * @ORM\Column(type="boolean", nullable=false)
  39.      */
  40.     private bool $privacyPolicyAccepted false;
  41.     public function __toString(): string
  42.     {
  43.         return sprintf('%s - %s'$this->type$this->name);
  44.     }
  45.     public function getLocation(): ?LocationInterface
  46.     {
  47.         return $this->location;
  48.     }
  49.     public function setLocation(?LocationInterface $location): void
  50.     {
  51.         $this->location $location;
  52.     }
  53.     public function getType(): ?string
  54.     {
  55.         return $this->type;
  56.     }
  57.     public function setType(?string $type): void
  58.     {
  59.         $this->type $type;
  60.     }
  61.     public function getName(): ?string
  62.     {
  63.         return $this->name;
  64.     }
  65.     public function setName(?string $name): void
  66.     {
  67.         $this->name $name;
  68.     }
  69.     public function getPhoneNumber(): ?string
  70.     {
  71.         return $this->phoneNumber;
  72.     }
  73.     public function setPhoneNumber(?string $phoneNumber): void
  74.     {
  75.         $this->phoneNumber $phoneNumber;
  76.     }
  77.     public function getEmail(): ?string
  78.     {
  79.         return $this->email;
  80.     }
  81.     public function setEmail(?string $email): void
  82.     {
  83.         $this->email $email;
  84.     }
  85.     public function getMessage(): ?string
  86.     {
  87.         return $this->message;
  88.     }
  89.     public function setMessage(?string $message): void
  90.     {
  91.         $this->message $message;
  92.     }
  93.     public function isPrivacyPolicyAccepted(): bool
  94.     {
  95.         return $this->privacyPolicyAccepted;
  96.     }
  97.     public function setPrivacyPolicyAccepted(bool $privacyPolicyAccepted): void
  98.     {
  99.         $this->privacyPolicyAccepted $privacyPolicyAccepted;
  100.     }
  101. }