src/Entity/Vetoadom/SousSecteur.php line 22

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Vetoadom;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use Symfony\Component\Validator\Constraints as Assert;
  5. use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  6. /**
  7.  * SousSecteur
  8.  *
  9.  * @ORM\Table(name="sous_secteur", uniqueConstraints={@ORM\UniqueConstraint(name="nom", columns={"nom"})}, indexes={@ORM\Index(name="FK_sous_secteur_secteur", columns={"secteur_id"})})
  10.  * @ORM\Entity(repositoryClass="App\Repository\Vetoadom\SousSecteurRepository")
  11.  * @ORM\HasLifecycleCallbacks()
  12.  * @UniqueEntity(
  13.  *     groups={"nom"},
  14.  *     fields={"nom"},
  15.  *     errorPath="nom",
  16.  *     message="page_admin_params_secteur.secteur_sous_secteur_nom_exist"
  17.  *  )
  18.  */
  19. class SousSecteur
  20. {
  21.     /**
  22.      * @var int
  23.      *
  24.      * @ORM\Column(name="id", type="integer", nullable=false)
  25.      * @ORM\Id
  26.      * @ORM\GeneratedValue(strategy="IDENTITY")
  27.      */
  28.     private $id;
  29.     /**
  30.      * @var string
  31.      *
  32.      * @ORM\Column(name="nom", type="string", length=30, nullable=false)
  33.      * @Assert\NotBlank(
  34.      *      groups={"nom"},
  35.      *      message="common.blank"
  36.      *   )
  37.      * @Assert\Length(
  38.      *      groups={"nom"},
  39.      *      max=30,
  40.      *      maxMessage="common.too_long"
  41.      *   )
  42.      */
  43.     private $nom;
  44.     /**
  45.      * @var bool
  46.      *
  47.      * @ORM\Column(name="planning1", type="boolean", nullable=false)
  48.      */
  49.     private $planning1 '0';
  50.     /**
  51.      * @var bool
  52.      *
  53.      * @ORM\Column(name="planning2", type="boolean", nullable=false)
  54.      */
  55.     private $planning2 '0';
  56.     /**
  57.      * @var \DateTime
  58.      *
  59.      * @ORM\Column(name="date_creation", type="datetime", nullable=false)
  60.      */
  61.     private $dateCreation;
  62.     /**
  63.      * @var \DateTime
  64.      *
  65.      * @ORM\Column(name="date_modification", type="datetime", nullable=false, options={"default"="CURRENT_TIMESTAMP"})
  66.      */
  67.     private $dateModification;
  68.     /**
  69.      * @var \Secteur
  70.      *
  71.      * @ORM\ManyToOne(targetEntity="Secteur", inversedBy="sousSecteur")
  72.      * @ORM\JoinColumns({
  73.      *   @ORM\JoinColumn(name="secteur_id", referencedColumnName="id")
  74.      * })
  75.      */
  76.     private $secteur;
  77.     public function getId(): ?int
  78.     {
  79.         return $this->id;
  80.     }
  81.     public function getNom(): ?string
  82.     {
  83.         return $this->nom;
  84.     }
  85.     public function setNom(string $nom): self
  86.     {
  87.         $this->nom $nom;
  88.         return $this;
  89.     }
  90.     public function getPlanning1(): ?bool
  91.     {
  92.         return $this->planning1;
  93.     }
  94.     public function setPlanning1(bool $planning1): self
  95.     {
  96.         $this->planning1 $planning1;
  97.         return $this;
  98.     }
  99.     public function getPlanning2(): ?bool
  100.     {
  101.         return $this->planning2;
  102.     }
  103.     public function setPlanning2(bool $planning2): self
  104.     {
  105.         $this->planning2 $planning2;
  106.         return $this;
  107.     }
  108.     public function getDateCreation(): ?\DateTimeInterface
  109.     {
  110.         return $this->dateCreation;
  111.     }
  112.     public function setDateCreation(\DateTimeInterface $dateCreation): self
  113.     {
  114.         $this->dateCreation $dateCreation;
  115.         return $this;
  116.     }
  117.     public function getDateModification(): ?\DateTimeInterface
  118.     {
  119.         return $this->dateModification;
  120.     }
  121.     public function setDateModification(\DateTimeInterface $dateModification): self
  122.     {
  123.         $this->dateModification $dateModification;
  124.         return $this;
  125.     }
  126.     public function getSecteur(): ?Secteur
  127.     {
  128.         return $this->secteur;
  129.     }
  130.     public function setSecteur(?Secteur $secteur): self
  131.     {
  132.         $this->secteur $secteur;
  133.         return $this;
  134.     }
  135.     /**
  136.      * @ORM\PrePersist
  137.      */
  138.     public function setCreatedAtValue()
  139.     {
  140.         $this->dateCreation = new \DateTimeImmutable();
  141.     }
  142. }