src/Entity/Imports/Entite.php line 21

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Imports;
  3. use App\Entity\Utilisateur\Utilisateur;
  4. use DateTime;
  5. use Doctrine\Common\Collections\ArrayCollection;
  6. use Doctrine\Common\Collections\Collection;
  7. use Doctrine\ORM\Mapping as ORM;
  8. use Gedmo\Mapping\Annotation as Gedmo;
  9. use Symfony\Component\Validator\Constraints as Assert;
  10. use App\Annotations\SecuredEntity;
  11. /**
  12.  * Entite
  13.  *
  14.  * @ORM\Table("import__entite")
  15.  * @ORM\Entity(repositoryClass="App\Repository\Imports\EntiteRepository")
  16.  * @Gedmo\SoftDeleteable(fieldName="dateSuppression",timeAware=false)
  17.  * @SecuredEntity (name="Entité", group="IMPORTS")
  18.  */
  19. class Entite
  20. {
  21.     /**
  22.      * @ORM\Column(name="id", type="integer")
  23.      * @ORM\Id
  24.      * @ORM\GeneratedValue(strategy="AUTO")
  25.      */
  26.     private $id;
  27.     
  28.     /**
  29.      * @ORM\OneToMany(targetEntity="App\Entity\Imports\Champ", cascade={"persist"},mappedBy="entite")
  30.      * @ORM\OrderBy({"libelle" = "ASC"})
  31.      */
  32.     private $champ;
  33.     
  34.     /**
  35.      * @ORM\ManyToOne(targetEntity="App\Entity\Utilisateur\Utilisateur", inversedBy="entiteImport")
  36.      * @ORM\JoinColumn(nullable=true)
  37.      */
  38.     private $utilisateur;
  39.     /**
  40.      * @ORM\ManyToOne(targetEntity="App\Entity\Utilisateur\Utilisateur", inversedBy="articleComptaImport")
  41.      * @ORM\JoinColumn(nullable=true)
  42.      */
  43.     private $utilisateurComptaImport;
  44.     /**
  45.      * @ORM\Column(name="date", type="datetime", nullable=true)
  46.      */
  47.     private $date;
  48.     
  49.     /**
  50.      * @ORM\Column(name="dateSuppression", type="datetime", nullable=true)
  51.      */
  52.     private $dateSuppression;
  53.     /**
  54.      * @ORM\Column(name="dateMaj", type="datetime", nullable=true)
  55.      * @Gedmo\Timestampable(on="update")
  56.      */
  57.     private $dateMaj;
  58.     /**
  59.      * @ORM\Column(name="libelle", type="string", length=255, nullable=true)
  60.      */
  61.     private $libelle;
  62.     
  63.     /**
  64.      * @ORM\Column(name="nom_table", type="string", length=255, nullable=true)
  65.      */
  66.     private $nomTable;
  67.         
  68.     /**
  69.      * @ORM\Column(name="description", type="text", nullable=true)
  70.     */
  71.     private $description;
  72.     public function __construct()
  73.     {
  74.         $this->date     = new Datetime();
  75.         $this->champ    = new ArrayCollection();
  76.     }
  77.     public function getId(): int
  78.     {
  79.         return $this->id;
  80.     }
  81.     public function setDate(?DateTime $date): Entite
  82.     {
  83.         $this->date $date;
  84.         return $this;
  85.     }
  86.     public function getDate(): ?DateTime
  87.     {
  88.         return $this->date;
  89.     }
  90.     public function setLibelle(?string $libelle): Entite
  91.     {
  92.         $this->libelle $libelle;
  93.         return $this;
  94.     }
  95.     public function getLibelle(): ?string
  96.     {
  97.         return $this->libelle;
  98.     }
  99.     public function setDateSuppression(?DateTime $dateSuppression): Entite
  100.     {
  101.         $this->dateSuppression $dateSuppression;
  102.         return $this;
  103.     }
  104.     public function getDateSuppression(): ?DateTime
  105.     {
  106.         return $this->dateSuppression;
  107.     }
  108.     public function setDateMaj(?DateTime $dateMaj): Entite
  109.     {
  110.         $this->dateMaj $dateMaj;
  111.         return $this;
  112.     }
  113.     public function getDateMaj(): ?DateTime
  114.     {
  115.         return $this->dateMaj;
  116.     }
  117.     public function setDescription(?string $description): Entite
  118.     {
  119.         $this->description $description;
  120.         return $this;
  121.     }
  122.     public function getDescription(): ?string
  123.     {
  124.         return $this->description;
  125.     }
  126.     public function setUtilisateur(?Utilisateur $utilisateur): Entite
  127.     {
  128.         $this->utilisateur $utilisateur;
  129.         return $this;
  130.     }
  131.     public function getUtilisateur(): ?Utilisateur
  132.     {
  133.         return $this->utilisateur;
  134.     }
  135.     
  136.     public function __toString() {
  137.         return $this->libelle;
  138.     }    
  139.     public function addChamp(Champ $champ): Entite
  140.     {
  141.         $this->champ[] = $champ;
  142.         return $this;
  143.     }
  144.     public function removeChamp(Champ $champ)
  145.     {
  146.         $this->champ->removeElement($champ);
  147.     }
  148.     public function getChamp(): Collection
  149.     {
  150.         return $this->champ;
  151.     }
  152.     public function setNomTable(?string $nomTable): Entite
  153.     {
  154.         $this->nomTable $nomTable;
  155.         return $this;
  156.     }
  157.     public function getNomTable(): ?string
  158.     {
  159.         return $this->nomTable;
  160.     }
  161. }