src/Entity/Purchases.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\PurchasesRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity(repositoryClass=PurchasesRepository::class)
  9.  */
  10. class Purchases
  11. {
  12.     /**
  13.      * @ORM\Id
  14.      * @ORM\GeneratedValue
  15.      * @ORM\Column(type="integer")
  16.      */
  17.     private $id;
  18.     /**
  19.      * @ORM\Column(type="datetime")
  20.      */
  21.     private $date;
  22.     /**
  23.      * @ORM\Column(type="float", nullable=true)
  24.      */
  25.     private $amount;
  26.     /**
  27.      * @ORM\Column(type="integer", nullable=true)
  28.      */
  29.     private $nb_products;
  30.     /**
  31.      * @ORM\Column(type="float", nullable=true)
  32.      */
  33.     private $amount_paid;
  34.     /**
  35.      * @ORM\Column(type="float", nullable=true)
  36.      */
  37.     private $amount_remaining;
  38.     /**
  39.      * @ORM\ManyToOne(targetEntity=Supplier::class, inversedBy="purchases")
  40.      * @ORM\JoinColumn(nullable=false)
  41.      */
  42.     private $supplier;
  43.     /**
  44.      * @ORM\OneToMany(targetEntity=Stock::class, mappedBy="purchase")
  45.      */
  46.     private $stocks;
  47.     /**
  48.      * @ORM\Column(type="string", length=255)
  49.      */
  50.     private $target;
  51.     /**
  52.      * @ORM\Column(type="boolean")
  53.      */
  54.     private $isSynch;
  55.     /**
  56.      * @ORM\Column(type="boolean")
  57.      */
  58.     private $deleted 0;
  59.     public function __construct()
  60.     {
  61.         $this->stocks = new ArrayCollection();
  62.     }
  63.     public function getId(): ?int
  64.     {
  65.         return $this->id;
  66.     }
  67.     public function getDate(): ?\DateTimeInterface
  68.     {
  69.         return $this->date;
  70.     }
  71.     public function setDate(\DateTimeInterface $date): self
  72.     {
  73.         $this->date $date;
  74.         return $this;
  75.     }
  76.     public function getAmount(): ?float
  77.     {
  78.         return $this->amount;
  79.     }
  80.     public function setAmount(?float $amount): self
  81.     {
  82.         $this->amount $amount;
  83.         return $this;
  84.     }
  85.     public function getNbProducts(): ?int
  86.     {
  87.         return $this->nb_products;
  88.     }
  89.     public function setNbProducts(?int $nb_products): self
  90.     {
  91.         $this->nb_products $nb_products;
  92.         return $this;
  93.     }
  94.     public function getAmountPaid(): ?float
  95.     {
  96.         return $this->amount_paid;
  97.     }
  98.     public function setAmountPaid(?float $amount_paid): self
  99.     {
  100.         $this->amount_paid $amount_paid;
  101.         return $this;
  102.     }
  103.     public function getAmountRemaining(): ?float
  104.     {
  105.         return $this->amount_remaining;
  106.     }
  107.     public function setAmountRemaining(?float $amount_remaining): self
  108.     {
  109.         $this->amount_remaining $amount_remaining;
  110.         return $this;
  111.     }
  112.     public function getSupplier(): ?Supplier
  113.     {
  114.         return $this->supplier;
  115.     }
  116.     public function setSupplier(?Supplier $supplier): self
  117.     {
  118.         $this->supplier $supplier;
  119.         return $this;
  120.     }
  121.     /**
  122.      * @return Collection<int, Stock>
  123.      */
  124.     public function getStocks(): Collection
  125.     {
  126.         return $this->stocks;
  127.     }
  128.     public function addStock(Stock $stock): self
  129.     {
  130.         if (!$this->stocks->contains($stock)) {
  131.             $this->stocks[] = $stock;
  132.             $stock->setPurchase($this);
  133.         }
  134.         return $this;
  135.     }
  136.     public function removeStock(Stock $stock): self
  137.     {
  138.         if ($this->stocks->removeElement($stock)) {
  139.             // set the owning side to null (unless already changed)
  140.             if ($stock->getPurchase() === $this) {
  141.                 $stock->setPurchase(null);
  142.             }
  143.         }
  144.         return $this;
  145.     }
  146.     /**
  147.      * @return mixed
  148.      */
  149.     public function getTarget()
  150.     {
  151.         return $this->target;
  152.     }
  153.     /**
  154.      * @param mixed $target
  155.      */
  156.     public function setTarget($target): void
  157.     {
  158.         $this->target $target;
  159.     }
  160.     /**
  161.      * @return mixed
  162.      */
  163.     public function getisSynch()
  164.     {
  165.         return $this->isSynch;
  166.     }
  167.     /**
  168.      * @param mixed $isSynch
  169.      */
  170.     public function setisSynch($isSynch): void
  171.     {
  172.         $this->isSynch $isSynch;
  173.     }
  174.     /**
  175.      * @return mixed
  176.      */
  177.     public function getDeleted()
  178.     {
  179.         return $this->deleted;
  180.     }
  181.     /**
  182.      * @param mixed $deleted
  183.      */
  184.     public function setDeleted($deleted): void
  185.     {
  186.         $this->deleted $deleted;
  187.     }
  188. }