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\OneToMany(targetEntity=Produit::class, mappedBy="tva")
  28.      */
  29.     private $produits;
  30.     public function __construct()
  31.     {
  32.         $this->produits = new ArrayCollection();
  33.     }
  34.     public function getId(): ?int
  35.     {
  36.         return $this->id;
  37.     }
  38.     public function getNumber(): ?float
  39.     {
  40.         return $this->number;
  41.     }
  42.     public function setNumber(float $number): self
  43.     {
  44.         $this->number $number;
  45.         return $this;
  46.     }
  47.     public function isDefault(): bool
  48.     {
  49.         return $this->isDefault;
  50.     }
  51.     public function setIsDefault(bool $isDefault): self
  52.     {
  53.         $this->isDefault $isDefault;
  54.         return $this;
  55.     }
  56.     
  57.     /**
  58.      * @return Collection|Produit[]
  59.      */
  60.     public function getProduits(): Collection
  61.     {
  62.         return $this->produits;
  63.     }
  64.     public function addProduit(Produit $produit): self
  65.     {
  66.         if( !$this->produits->contains($produit)) {
  67.             $this->produits[] = $produit;
  68.             $produit->setTva($this);
  69.         }
  70.         return $this;
  71.     }
  72.     public function removeProduit(Produit $produit): self
  73.     {
  74.         if( $this->produits->removeElement($produit)) {
  75.             // set the owning side to null (unless already changed)
  76.             if( $produit->getTva() === $this) {
  77.                 $produit->setTva(null);
  78.             }
  79.         }
  80.         return $this;
  81.     }
  82. }