<?php
namespace App\Entity;
use App\Entity\Trait\CreatedAtTrait;
use App\Repository\PrestationsRepository;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
#[ORM\Entity(repositoryClass: PrestationsRepository::class)]
class Prestations
{
use CreatedAtTrait;
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(length: 255)]
#[Assert\NotBlank(message: 'Ce champs est obligatoire')]
private ?string $name = null;
#[ORM\Column(length: 255)]
#[Assert\NotBlank(message: 'Ce champs est obligatoire')]
private ?string $description = null;
#[ORM\Column(length: 255)]
#[Assert\NotBlank(message: 'Ce champs est obligatoire')]
private ?string $slug = null;
#[ORM\ManyToOne(inversedBy: 'prestations')]
#[ORM\JoinColumn(nullable: false)]
private ?Users $users = null;
public function __construct()
{
$this->created_at = new \DateTimeImmutable();
//// $this->createdAt = new \DateTimeImmutable(); /////////////////
}
public function getId(): ?int
{
return $this->id;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(string $name): static
{
$this->name = $name;
return $this;
}
public function getDescription(): ?string
{
return $this->description;
}
public function setDescription(string $description): static
{
$this->description = $description;
return $this;
}
public function getSlug(): ?string
{
return $this->slug;
}
public function setSlug(string $slug): static
{
$this->slug = $slug;
return $this;
}
public function getUsers(): ?Users
{
return $this->users;
}
public function setUsers(?Users $users): static
{
$this->users = $users;
return $this;
}
}