src/Flexy/ShopBundle/Entity/Order/Contacts.php line 13

  1. <?php
  2. namespace App\Flexy\ShopBundle\Entity\Order;
  3. use App\Flexy\ShopBundle\Repository\Order\ContactsRepository;
  4. use Doctrine\DBAL\Types\Types;
  5. use ApiPlatform\Core\Annotation\ApiResource;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ApiResource]
  8. #[ORM\Entity(repositoryClassContactsRepository::class)]
  9. class Contacts
  10. {
  11.     #[ORM\Id]
  12.     #[ORM\GeneratedValue]
  13.     #[ORM\Column]
  14.     private ?int $id null;
  15.     #[ORM\Column(length255nullabletrue)]
  16.     private ?string $fullName null;
  17.     #[ORM\Column(length255nullabletrue)]
  18.     private ?string $email null;
  19.     #[ORM\Column(length255nullabletrue)]
  20.     private ?string $phone null;
  21.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  22.     private ?string $message null;
  23.  #[ORM\Column(nullabletrue)]
  24.                       private ?bool $isNewLead null;
  25.     #[ORM\Column(typeTypes::DATETIME_MUTABLEnullabletrue)]
  26.     private ?\DateTimeInterface $createdAt null;
  27.     #[ORM\Column(typeTypes::SMALLINTnullabletrue)]
  28.     private ?int $processed null;
  29.   
  30.  public function __construct()
  31.              {
  32.                  // Set the current date when the entity is created
  33.                  $this->createdAt = new \DateTime();
  34.              }
  35.     public function getId(): ?int
  36.     {
  37.         return $this->id;
  38.     }
  39.     public function getFullName(): ?string
  40.     {
  41.         return $this->fullName;
  42.     }
  43.     public function setFullName(?string $fullName): static
  44.     {
  45.         $this->fullName $fullName;
  46.         return $this;
  47.     }
  48.     
  49.     public function getPhone(): ?string
  50.     {
  51.         return $this->phone;
  52.     }
  53.     public function setPhone(?string $phone): static
  54.     {
  55.         $this->phone $phone;
  56.         return $this;
  57.     }
  58.     public function getEmail(): ?string
  59.     {
  60.         return $this->email;
  61.     }
  62.     public function setEmail(?string $email): static
  63.     {
  64.         $this->email $email;
  65.         return $this;
  66.     }
  67.     public function getMessage(): ?string
  68.     {
  69.         return $this->message;
  70.     }
  71.     public function setMessage(?string $message): static
  72.     {
  73.         $this->message $message;
  74.         return $this;
  75.     }
  76.     public function isIsNewLead(): ?bool
  77.     {
  78.         return $this->isNewLead;
  79.     }
  80.     public function setIsNewLead(?bool $isNewLead): static
  81.     {
  82.         $this->isNewLead $isNewLead;
  83.         return $this;
  84.     }
  85.     
  86.     
  87. public function getExportData()
  88. {
  89.     return \array_merge([
  90.         'Id ' => $this->id,
  91.         'Nom complet' => $this->fullName,
  92.         'Email' => $this->email,
  93.         'Téléphone' => $this->phone,
  94.         // Force the message to be UTF-8
  95.         'Message' => mb_convert_encoding(strip_tags($this->message), 'UTF-8''auto'),
  96.         'Creé le' => $this->createdAt $this->createdAt->format('Y-m-d H:i:s') : ''
  97.     ]);
  98. }
  99. public function getCreatedAt(): ?\DateTimeInterface
  100. {
  101.     return $this->createdAt;
  102. }
  103. public function setCreatedAt(?\DateTimeInterface $createdAt): static
  104. {
  105.     $this->createdAt $createdAt;
  106.     return $this;
  107. }
  108. public function getProcessed(): ?int
  109. {
  110.     return $this->processed;
  111. }
  112. public function setProcessed(?int $processed): static
  113. {
  114.     $this->processed $processed;
  115.     return $this;
  116. }
  117. }