src/Entity/CmsPartner.php line 10

  1. <?php
  2. namespace App\Entity;
  3. use ApiPlatform\Metadata\ApiResource;
  4. use App\Repository\CmsPartnerRepository;
  5. use Doctrine\ORM\Mapping as ORM;
  6. #[ORM\Entity(repositoryClassCmsPartnerRepository::class)]
  7. class CmsPartner
  8. {
  9.     #[ORM\Id]
  10.     #[ORM\GeneratedValue]
  11.     #[ORM\Column]
  12.     private ?int $id null;
  13.     #[ORM\Column(length255)]
  14.     private ?string $name null;
  15.     #[ORM\Column(length255nullabletrue)]
  16.     private ?string $description null;
  17.     #[ORM\Column(options: ["default" => false])]
  18.     private ?bool $isVisible false;
  19.     #[ORM\Column]
  20.     private ?\DateTimeImmutable $joinedAt null;
  21.     #[ORM\Column]
  22.     private ?\DateTimeImmutable $createdAt null;
  23.     #[ORM\Column]
  24.     private ?\DateTimeImmutable $updatedAt;
  25.     #[ORM\OneToOne(cascade: ['persist''remove'])]
  26.     private ?Attachment $thumbnail null;
  27.     public function __construct()
  28.     {
  29.         if (!$this->createdAt)
  30.             $this->createdAt = new \DateTimeImmutable();
  31.         $this->updatedAt = new \DateTimeImmutable();
  32.     }
  33.     public function getId(): ?int
  34.     {
  35.         return $this->id;
  36.     }
  37.     public function getName(): ?string
  38.     {
  39.         return $this->name;
  40.     }
  41.     public function setName(string $name): self
  42.     {
  43.         $this->name $name;
  44.         return $this;
  45.     }
  46.     public function getDescription(): ?string
  47.     {
  48.         return $this->description;
  49.     }
  50.     public function setDescription(?string $description): self
  51.     {
  52.         $this->description $description;
  53.         return $this;
  54.     }
  55.     public function isIsVisible(): ?bool
  56.     {
  57.         return $this->isVisible;
  58.     }
  59.     public function setIsVisible(bool $isVisible): self
  60.     {
  61.         $this->isVisible $isVisible;
  62.         return $this;
  63.     }
  64.     public function getJoinedAt(): ?\DateTimeImmutable
  65.     {
  66.         return $this->joinedAt;
  67.     }
  68.     public function setJoinedAt(\DateTimeImmutable $joinedAt): self
  69.     {
  70.         $this->joinedAt $joinedAt;
  71.         return $this;
  72.     }
  73.     public function getCreatedAt(): ?\DateTimeImmutable
  74.     {
  75.         return $this->createdAt;
  76.     }
  77.     public function setCreatedAt(\DateTimeImmutable $createdAt): self
  78.     {
  79.         $this->createdAt $createdAt;
  80.         return $this;
  81.     }
  82.     public function getUpdatedAt(): ?\DateTimeImmutable
  83.     {
  84.         return $this->updatedAt;
  85.     }
  86.     public function setUpdatedAt(\DateTimeImmutable $updatedAt): self
  87.     {
  88.         $this->updatedAt $updatedAt;
  89.         return $this;
  90.     }
  91.     public function getThumbnail(): ?Attachment
  92.     {
  93.         return $this->thumbnail;
  94.     }
  95.     public function setThumbnail(?Attachment $thumbnail): self
  96.     {
  97.         $this->thumbnail $thumbnail;
  98.         return $this;
  99.     }
  100. }