src/Entity/Prestations.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Entity\Trait\CreatedAtTrait;
  4. use App\Repository\PrestationsRepository;
  5. use Doctrine\ORM\Mapping as ORM;
  6. use Symfony\Component\Validator\Constraints as Assert;
  7. #[ORM\Entity(repositoryClassPrestationsRepository::class)]
  8. class Prestations
  9. {
  10.     use CreatedAtTrait;
  11.     #[ORM\Id]
  12.     #[ORM\GeneratedValue]
  13.     #[ORM\Column]
  14.     private ?int $id null;
  15.     #[ORM\Column(length255)]
  16.     #[Assert\NotBlank(message'Ce champs est obligatoire')]
  17.     private ?string $name null;
  18.     #[ORM\Column(length255)]
  19.     #[Assert\NotBlank(message'Ce champs est obligatoire')]
  20.     private ?string $description null;
  21.     #[ORM\Column(length255)]
  22.     #[Assert\NotBlank(message'Ce champs est obligatoire')]
  23.     private ?string $slug null;
  24.     #[ORM\ManyToOne(inversedBy'prestations')]
  25.     #[ORM\JoinColumn(nullablefalse)]
  26.     private ?Users $users null;
  27.     public function __construct()
  28.     {
  29.         $this->created_at = new \DateTimeImmutable();
  30.         //// $this->createdAt = new \DateTimeImmutable(); /////////////////
  31.     }
  32.     public function getId(): ?int
  33.     {
  34.         return $this->id;
  35.     }
  36.     public function getName(): ?string
  37.     {
  38.         return $this->name;
  39.     }
  40.     public function setName(string $name): static
  41.     {
  42.         $this->name $name;
  43.         return $this;
  44.     }
  45.     public function getDescription(): ?string
  46.     {
  47.         return $this->description;
  48.     }
  49.     public function setDescription(string $description): static
  50.     {
  51.         $this->description $description;
  52.         return $this;
  53.     }
  54.     public function getSlug(): ?string
  55.     {
  56.         return $this->slug;
  57.     }
  58.     public function setSlug(string $slug): static
  59.     {
  60.         $this->slug $slug;
  61.         return $this;
  62.     }
  63.     public function getUsers(): ?Users
  64.     {
  65.         return $this->users;
  66.     }
  67.     public function setUsers(?Users $users): static
  68.     {
  69.         $this->users $users;
  70.         return $this;
  71.     }
  72. }