src/Entity/Services.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ServicesRepository;
  4. use DH\Auditor\Provider\Doctrine\Auditing\Annotation\Auditable;
  5. use Doctrine\ORM\Mapping as ORM;
  6. use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  7. /**
  8.  * @ORM\Entity(repositoryClass=ServicesRepository::class)
  9.  * @UniqueEntity(fields={"label"}, message="Ce service existe déjà.")
  10.  * @Auditable()
  11.  */
  12. class Services
  13. {
  14.     /**
  15.      * @ORM\Id()
  16.      * @ORM\GeneratedValue()
  17.      * @ORM\Column(type="integer")
  18.      */
  19.     private $id;
  20.     /**
  21.      * @ORM\Column(type="string", length=255)
  22.      */
  23.     private $label;
  24.     /**
  25.      * @ORM\Column(type="boolean", nullable=true)
  26.      */
  27.     private $isDeleted;
  28.     /**
  29.      * @ORM\ManyToOne(targetEntity=Users::class)
  30.      */
  31.     private $userCreate;
  32.     /**
  33.      * @ORM\ManyToOne(targetEntity=Users::class)
  34.      */
  35.     private $userUpdate;
  36.     /**
  37.      * @ORM\Column(type="datetime", nullable=true)
  38.      */
  39.     private $dateCreate;
  40.     /**
  41.      * @ORM\Column(type="datetime", nullable=true)
  42.      */
  43.     private $dateUpdate;
  44.     public function __construct()
  45.     {
  46.         $this->isDeleted false;
  47.         $this->dateCreate = new \DateTime();
  48.     }
  49.     public function getId(): ?int
  50.     {
  51.         return $this->id;
  52.     }
  53.     public function getLabel(): ?string
  54.     {
  55.         return $this->label;
  56.     }
  57.     public function setLabel(string $label): self
  58.     {
  59.         $this->label $label;
  60.         return $this;
  61.     }
  62.     public function getIsDeleted(): ?bool
  63.     {
  64.         return $this->isDeleted;
  65.     }
  66.     public function setIsDeleted(?bool $isDeleted): self
  67.     {
  68.         $this->isDeleted $isDeleted;
  69.         return $this;
  70.     }
  71.     public function getUserCreate(): ?Users
  72.     {
  73.         return $this->userCreate;
  74.     }
  75.     public function setUserCreate(?Users $userCreate): self
  76.     {
  77.         $this->userCreate $userCreate;
  78.         return $this;
  79.     }
  80.     public function getUserUpdate(): ?Users
  81.     {
  82.         return $this->userUpdate;
  83.     }
  84.     public function setUserUpdate(?Users $userUpdate): self
  85.     {
  86.         $this->userUpdate $userUpdate;
  87.         return $this;
  88.     }
  89.     public function getDateCreate(): ?\DateTimeInterface
  90.     {
  91.         return $this->dateCreate;
  92.     }
  93.     public function setDateCreate(?\DateTimeInterface $dateCreate): self
  94.     {
  95.         $this->dateCreate $dateCreate;
  96.         return $this;
  97.     }
  98.     public function getDateUpdate(): ?\DateTimeInterface
  99.     {
  100.         return $this->dateUpdate;
  101.     }
  102.     public function setDateUpdate(?\DateTimeInterface $dateUpdate): self
  103.     {
  104.         $this->dateUpdate $dateUpdate;
  105.         return $this;
  106.     }
  107. }