src/Entity/Contact.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use ApiPlatform\Metadata\ApiResource;
  4. use App\Repository\ContactRepository;
  5. use App\Traits\Actions;
  6. use Doctrine\Common\Collections\ArrayCollection;
  7. use Doctrine\ORM\Mapping as ORM;
  8. #[ORM\Entity(repositoryClassContactRepository::class)]
  9. #[ApiResource]
  10. class Contact
  11. {
  12.     use Actions;
  13.     #[ORM\Column(length255nullabletrue)]
  14.     private ?string $name null;
  15.     #[ORM\Column(length255nullabletrue)]
  16.     private ?string $type 'contact';
  17.     #[ORM\Column(length255nullabletrue)]
  18.     private ?string $email null;
  19.     #[ORM\Column(length20nullabletrue)]
  20.     private ?string $phone null;
  21.     public function __construct()
  22.     {
  23.         // date_default_timezone_set('Africa/Casablanca');
  24.         $this->createAt=new \DateTime('now');
  25.         $this->published=false;
  26.     }
  27.     public function getName(): ?string
  28.     {
  29.         return $this->name;
  30.     }
  31.     public function setName(?string $name): self
  32.     {
  33.         $this->name $name;
  34.         return $this;
  35.     }
  36.     public function getEmail(): ?string
  37.     {
  38.         return $this->email;
  39.     }
  40.     public function setEmail(?string $email): self
  41.     {
  42.         $this->email $email;
  43.         return $this;
  44.     }
  45.     public function getPhone(): ?string
  46.     {
  47.         return $this->phone;
  48.     }
  49.     public function setPhone(?string $phone): self
  50.     {
  51.         $this->phone $phone;
  52.         return $this;
  53.     }
  54.     public function getType(): ?string
  55.     {
  56.         return $this->type;
  57.     }
  58.     public function setType(?string $type): Contact
  59.     {
  60.         $this->type $type;
  61.         return $this;
  62.     }
  63. }