src/Entity/Articles/Compta.php line 22

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Articles;
  3. use App\Entity\Clients\Client;
  4. use App\Entity\Fournisseurs\Fournisseur;
  5. use App\Entity\Utilisateur\Utilisateur;
  6. use DateTime;
  7. use Doctrine\Common\Collections\ArrayCollection;
  8. use Doctrine\Common\Collections\Collection;
  9. use Doctrine\ORM\Mapping as ORM;
  10. use Gedmo\Mapping\Annotation as Gedmo;
  11. use Symfony\Component\Validator\Constraints as Assert;
  12. use App\Annotations\SecuredEntity;
  13. /**
  14.  * Compta
  15.  *
  16.  * @ORM\Table(name="article__compta")
  17.  * @ORM\Entity(repositoryClass="App\Repository\Articles\ComptaRepository")
  18.  * @SecuredEntity(name="EntrĂ©e", group="COMPTABILITE")
  19.  */
  20. class Compta
  21. {
  22.     /**
  23.      * @ORM\Column(name="id", type="integer")
  24.      * @ORM\Id
  25.      * @ORM\GeneratedValue(strategy="AUTO")
  26.      */
  27.     private $id;
  28.     
  29.     /**
  30.      * @ORM\ManyToOne(targetEntity="App\Entity\Utilisateur\Utilisateur", inversedBy="compta")
  31.      * @ORM\JoinColumn(nullable=true)
  32.      */
  33.     private $utilisateur;
  34.     
  35.     /**
  36.      * @ORM\Column(name="tva", type="boolean", nullable=true)
  37.      */
  38.     private $tva;
  39.     
  40.     /**
  41.      * @ORM\Column(name="date", type="datetime", nullable=true)
  42.      */
  43.     private $date;
  44.     /**
  45.      * @ORM\Column(name="date_suppression", type="datetime", nullable=true)
  46.      */
  47.     private $dateSuppression;
  48.     /**
  49.      * @ORM\Column(name="date_maj", type="datetime", nullable=true)
  50.      * @Gedmo\Timestampable(on="update")
  51.      */
  52.     private $dateMaj;
  53.     /**
  54.      * @ORM\Column(name="name", type="string", length=255, nullable=true)
  55.      * @Assert\NotBlank(message="LibellĂ© obligatoire")
  56.      */
  57.     private $name;
  58.     
  59.     /**
  60.     * @ORM\OneToMany(targetEntity="App\Entity\Articles\FamilleComptaCompta", mappedBy="compta")
  61.     */
  62.     private $familleComptaCompta;
  63.     
  64.     /**
  65.     * @ORM\OneToMany(targetEntity="App\Entity\Clients\Client", mappedBy="compta",)
  66.     */
  67.     private $clients;
  68.     
  69.     /**
  70.     * @ORM\OneToMany(targetEntity="App\Entity\Fournisseurs\Fournisseur", mappedBy="compta")
  71.     */
  72.     private $fournisseurs;
  73.     public function getId(): int
  74.     {
  75.         return $this->id;
  76.     }
  77.     public function setName(?string $name): Compta
  78.     {
  79.         $this->name $name;
  80.         return $this;
  81.     }
  82.     public function getName(): ?string
  83.     {
  84.         return $this->name;
  85.     }
  86.     /**
  87.      * Constructor
  88.      */
  89.     public function __construct()
  90.     {
  91.         $this->date                 = new Datetime();
  92.         $this->clients              = new ArrayCollection();
  93.         $this->fournisseurs         = new ArrayCollection();
  94.         $this->familleComptaCompta  = new ArrayCollection();
  95.         
  96.     }
  97.     public function __toString()
  98.     {
  99.         return $this->getName();
  100.     }
  101.     public function setDate(?DateTime $date): Compta
  102.     {
  103.         $this->date $date;
  104.         return $this;
  105.     }
  106.     public function getDate(): ?DateTime
  107.     {
  108.         return $this->date;
  109.     }
  110.     public function setDateSuppression(?DateTime $dateSuppression): Compta
  111.     {
  112.         $this->dateSuppression $dateSuppression;
  113.         return $this;
  114.     }
  115.     public function getDateSuppression(): ?DateTime
  116.     {
  117.         return $this->dateSuppression;
  118.     }
  119.     public function setDateMaj(DateTime $dateMaj): Compta
  120.     {
  121.         $this->dateMaj $dateMaj;
  122.         return $this;
  123.     }
  124.     public function getDateMaj(): ?DateTime
  125.     {
  126.         return $this->dateMaj;
  127.     }
  128.     public function setUtilisateur(?Utilisateur $utilisateur): Compta
  129.     {
  130.         $this->utilisateur $utilisateur;
  131.         return $this;
  132.     }
  133.     public function getUtilisateur(): ?Utilisateur
  134.     {
  135.         return $this->utilisateur;
  136.     }
  137.     public function addFamilleComptaComptum(FamilleComptaCompta $familleComptaComptum): Compta
  138.     {
  139.         $this->familleComptaCompta[] = $familleComptaComptum;
  140.         return $this;
  141.     }
  142.     public function removeFamilleComptaComptum(FamilleComptaCompta $familleComptaComptum)
  143.     {
  144.         $this->familleComptaCompta->removeElement($familleComptaComptum);
  145.     }
  146.     public function getFamilleComptaCompta(): ArrayCollection
  147.     {
  148.         return $this->familleComptaCompta;
  149.     }
  150.     public function addClient(Client $client): Compta
  151.     {
  152.         $this->clients[] = $client;
  153.         return $this;
  154.     }
  155.     public function removeClient(Client $client)
  156.     {
  157.         $this->clients->removeElement($client);
  158.     }
  159.     public function getClients(): ArrayCollection
  160.     {
  161.         return $this->clients;
  162.     }
  163.     public function addFournisseur(Fournisseur $fournisseur): Compta
  164.     {
  165.         $this->fournisseurs[] = $fournisseur;
  166.         return $this;
  167.     }
  168.     public function removeFournisseur(Fournisseur $fournisseur)
  169.     {
  170.         $this->fournisseurs->removeElement($fournisseur);
  171.     }
  172.     public function getFournisseurs(): ArrayCollection
  173.     {
  174.         return $this->fournisseurs;
  175.     }
  176.     public function setTva(?bool $tva): Compta
  177.     {
  178.         $this->tva $tva;
  179.         return $this;
  180.     }
  181.     public function getTva(): ?bool
  182.     {
  183.         return $this->tva;
  184.     }
  185. }