src/Entity/Webfactory/Actualites/WebfactoryActualiteCategoryContenu.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Webfactory\Actualites;
  3. use App\Repository\Webfactory\Actualites\WebfactoryActualiteCategoryContenuRepository;
  4. use DateTimeImmutable;
  5. use Doctrine\DBAL\Types\Types;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassWebfactoryActualiteCategoryContenuRepository::class)]
  8. #[ORM\HasLifecycleCallbacks]
  9. class WebfactoryActualiteCategoryContenu
  10. {
  11.     #[ORM\Id]
  12.     #[ORM\GeneratedValue]
  13.     #[ORM\Column]
  14.     private ?int $id null;
  15.     #[ORM\Column(length255)]
  16.     private ?string $name null;
  17.     #[ORM\Column(length255)]
  18.     private ?string $slug null;
  19.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  20.     private ?string $description null;
  21.     #[ORM\Column(length255)]
  22.     private ?string $lang null;
  23.     #[ORM\Column]
  24.     private ?DateTimeImmutable $created_at;
  25.     #[ORM\Column]
  26.     private ?DateTimeImmutable $updated_at;
  27.     #[ORM\ManyToOne(inversedBy'webfactoryActualiteCategoryContenus')]
  28.     private ?WebfactoryActualiteCategory $webfactory_category null;
  29.     public function __construct()
  30.     {
  31.         $this->created_at = new DateTimeImmutable("now");
  32.         $this->updated_at = new DateTimeImmutable("now");
  33.     }
  34.     #[ORM\PreUpdate]
  35.     public function onPreUpdateEntity(): void
  36.     {
  37.         $this->updated_at = new \DateTimeImmutable('now');
  38.     }
  39.     public function getId(): ?int
  40.     {
  41.         return $this->id;
  42.     }
  43.     public function getName(): ?string
  44.     {
  45.         return $this->name;
  46.     }
  47.     public function setName(string $name): static
  48.     {
  49.         $this->name $name;
  50.         return $this;
  51.     }
  52.     public function getSlug(): ?string
  53.     {
  54.         return $this->slug;
  55.     }
  56.     public function setSlug(string $slug): static
  57.     {
  58.         $this->slug $slug;
  59.         return $this;
  60.     }
  61.     public function getDescription(): ?string
  62.     {
  63.         return $this->description;
  64.     }
  65.     public function setDescription(?string $description): static
  66.     {
  67.         $this->description $description;
  68.         return $this;
  69.     }
  70.     public function getLang(): ?string
  71.     {
  72.         return $this->lang;
  73.     }
  74.     public function setLang(string $lang): static
  75.     {
  76.         $this->lang $lang;
  77.         return $this;
  78.     }
  79.     public function getCreatedAt(): ?DateTimeImmutable
  80.     {
  81.         return $this->created_at;
  82.     }
  83.     public function setCreatedAt(DateTimeImmutable $created_at): static
  84.     {
  85.         $this->created_at $created_at;
  86.         return $this;
  87.     }
  88.     public function getUpdatedAt(): ?DateTimeImmutable
  89.     {
  90.         return $this->updated_at;
  91.     }
  92.     public function setUpdatedAt(DateTimeImmutable $updated_at): static
  93.     {
  94.         $this->updated_at $updated_at;
  95.         return $this;
  96.     }
  97.     public function getWebfactoryCategory(): ?WebfactoryActualiteCategory
  98.     {
  99.         return $this->webfactory_category;
  100.     }
  101.     public function setWebfactoryCategory(?WebfactoryActualiteCategory $webfactory_category): static
  102.     {
  103.         $this->webfactory_category $webfactory_category;
  104.         return $this;
  105.     }
  106.     public function __toString(): string
  107.     {
  108.         return $this->name;
  109.     }
  110. }