src/Entity/Contact/Data.php line 18

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Contact;
  3. use App\Entity\Interfaces\InquiryInterface;
  4. use App\Entity\Traits\InquiryTrait;
  5. use App\Entity\Traits\ModifiedTimeTrait;
  6. use App\Repository\Contact\DataRepository;
  7. use Doctrine\DBAL\Types\Types;
  8. use Doctrine\ORM\Mapping as ORM;
  9. use Gedmo\Mapping\Annotation as Gedmo;
  10. use Gedmo\SoftDeleteable\Traits\SoftDeleteableEntity;
  11. use TripleE\Utilities\Entity\Interfaces\CsvExportInterface;
  12. #[ORM\Entity(repositoryClassDataRepository::class)]
  13. #[ORM\Table(name"inquiry_contact_data")]
  14. #[ORM\HasLifecycleCallbacks]
  15. #[Gedmo\SoftDeleteable(fieldName"deletedAt"timeAwarefalsehardDeletefalse)]
  16. class Data implements InquiryInterfaceCsvExportInterface
  17. {
  18.     use SoftDeleteableEntity;
  19.     use ModifiedTimeTrait;
  20.     use InquiryTrait;
  21.     #[ORM\Column(length255nullabletrue)]
  22.     private ?string $name null;
  23.     #[ORM\Column(length255nullabletrue)]
  24.     private ?string $kana null;
  25.     #[ORM\Column(length255nullabletrue)]
  26.     private ?string $phone null;
  27.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  28.     private ?string $message null;
  29.     
  30.     public function getCsvRow(): array
  31.     {
  32.         return [
  33.             [
  34.                 "header" => "ID",
  35.                 "value" => $this->getId()
  36.             ],
  37.             [
  38.                 "header" => "日時",
  39.                 "value" => $this->created_at->format("Y/m/d H:i:s")
  40.             ],
  41.             [
  42.                 "header" => "お名前",
  43.                 "value" => $this->getName()
  44.             ],
  45.             [
  46.                 "header" => "ふりがな",
  47.                 "value" => $this->getKana()
  48.             ],
  49.             [
  50.                 "header" => "電話番号",
  51.                 "value" => $this->getPhone()
  52.             ],
  53.             [
  54.                 "header" => "Email",
  55.                 "value" => $this->getEmail()
  56.             ],
  57.             [
  58.                 "header" => "お問合せ内容",
  59.                 "value" => $this->getMessage()
  60.             ],
  61.             [
  62.                 "header" => "IPアドレス",
  63.                 "value" => $this->getIp()
  64.             ],
  65.         ];
  66.     }
  67.     public function getName(): ?string
  68.     {
  69.         return $this->name;
  70.     }
  71.     public function setName(?string $name): self
  72.     {
  73.         $this->name $name;
  74.         return $this;
  75.     }
  76.     public function getKana(): ?string
  77.     {
  78.         return $this->kana;
  79.     }
  80.     public function setKana(?string $kana): self
  81.     {
  82.         $this->kana $kana;
  83.         return $this;
  84.     }
  85.     public function getPhone(): ?string
  86.     {
  87.         return $this->phone;
  88.     }
  89.     public function setPhone(?string $phone): self
  90.     {
  91.         $this->phone $phone;
  92.         return $this;
  93.     }
  94.     public function getMessage(): ?string
  95.     {
  96.         return $this->message;
  97.     }
  98.     public function setMessage(?string $message): self
  99.     {
  100.         $this->message $message;
  101.         return $this;
  102.     }
  103. }