src/Flexy/ShopBundle/Entity/Order/Contacts.php line 13
<?php
namespace App\Flexy\ShopBundle\Entity\Order;
use App\Flexy\ShopBundle\Repository\Order\ContactsRepository;
use Doctrine\DBAL\Types\Types;
use ApiPlatform\Core\Annotation\ApiResource;
use Doctrine\ORM\Mapping as ORM;
#[ApiResource]
#[ORM\Entity(repositoryClass: ContactsRepository::class)]
class Contacts
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $fullName = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $email = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $phone = null;
#[ORM\Column(type: Types::TEXT, nullable: true)]
private ?string $message = null;
#[ORM\Column(nullable: true)]
private ?bool $isNewLead = null;
#[ORM\Column(type: Types::DATETIME_MUTABLE, nullable: true)]
private ?\DateTimeInterface $createdAt = null;
#[ORM\Column(type: Types::SMALLINT, nullable: true)]
private ?int $processed = null;
public function __construct()
{
// Set the current date when the entity is created
$this->createdAt = new \DateTime();
}
public function getId(): ?int
{
return $this->id;
}
public function getFullName(): ?string
{
return $this->fullName;
}
public function setFullName(?string $fullName): static
{
$this->fullName = $fullName;
return $this;
}
public function getPhone(): ?string
{
return $this->phone;
}
public function setPhone(?string $phone): static
{
$this->phone = $phone;
return $this;
}
public function getEmail(): ?string
{
return $this->email;
}
public function setEmail(?string $email): static
{
$this->email = $email;
return $this;
}
public function getMessage(): ?string
{
return $this->message;
}
public function setMessage(?string $message): static
{
$this->message = $message;
return $this;
}
public function isIsNewLead(): ?bool
{
return $this->isNewLead;
}
public function setIsNewLead(?bool $isNewLead): static
{
$this->isNewLead = $isNewLead;
return $this;
}
public function getExportData()
{
return \array_merge([
'Id ' => $this->id,
'Nom complet' => $this->fullName,
'Email' => $this->email,
'Téléphone' => $this->phone,
// Force the message to be UTF-8
'Message' => mb_convert_encoding(strip_tags($this->message), 'UTF-8', 'auto'),
'Creé le' => $this->createdAt ? $this->createdAt->format('Y-m-d H:i:s') : '',
]);
}
public function getCreatedAt(): ?\DateTimeInterface
{
return $this->createdAt;
}
public function setCreatedAt(?\DateTimeInterface $createdAt): static
{
$this->createdAt = $createdAt;
return $this;
}
public function getProcessed(): ?int
{
return $this->processed;
}
public function setProcessed(?int $processed): static
{
$this->processed = $processed;
return $this;
}
}