src/Entity/Tva.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\TvaRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity(repositoryClass=TvaRepository::class)
  9.  */
  10. class Tva
  11. {
  12.     /**
  13.      * @ORM\Id
  14.      * @ORM\GeneratedValue
  15.      * @ORM\Column(type="integer")
  16.      */
  17.     private $id;
  18.     /**
  19.      * @ORM\Column(type="float")
  20.      */
  21.     private $number;
  22.     /**
  23.      * @ORM\Column(type="boolean", options={"default": false})
  24.      */
  25.     private $isDefault false;
  26.     /**
  27.      * @ORM\Column(type="boolean", options={"default": true})
  28.      */
  29.     private $isActive true;
  30.     /**
  31.      * @ORM\OneToMany(targetEntity=Produit::class, mappedBy="tva")
  32.      */
  33.     private $produits;
  34.     public function __construct()
  35.     {
  36.         $this->produits = new ArrayCollection();
  37.     }
  38.     public function getId(): ?int
  39.     {
  40.         return $this->id;
  41.     }
  42.     public function getNumber(): ?float
  43.     {
  44.         return $this->number;
  45.     }
  46.     public function setNumber(float $number): self
  47.     {
  48.         $this->number $number;
  49.         return $this;
  50.     }
  51.     public function isDefault(): bool
  52.     {
  53.         return $this->isDefault;
  54.     }
  55.     public function setIsDefault(bool $isDefault): self
  56.     {
  57.         $this->isDefault $isDefault;
  58.         return $this;
  59.     }
  60.     public function isActive(): bool
  61.     {
  62.         return $this->isActive;
  63.     }
  64.     public function setIsActive(bool $isActive): self
  65.     {
  66.         $this->isActive $isActive;
  67.         return $this;
  68.     }
  69.     /**
  70.      * @return Collection|Produit[]
  71.      */
  72.     public function getProduits(): Collection
  73.     {
  74.         return $this->produits;
  75.     }
  76.     public function addProduit(Produit $produit): self
  77.     {
  78.         if( !$this->produits->contains($produit)) {
  79.             $this->produits[] = $produit;
  80.             $produit->setTva($this);
  81.         }
  82.         return $this;
  83.     }
  84.     public function removeProduit(Produit $produit): self
  85.     {
  86.         if( $this->produits->removeElement($produit)) {
  87.             // set the owning side to null (unless already changed)
  88.             if( $produit->getTva() === $this) {
  89.                 $produit->setTva(null);
  90.             }
  91.         }
  92.         return $this;
  93.     }
  94. }