src/Entity/Sales.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\SalesRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity(repositoryClass=SalesRepository::class)
  9.  */
  10. class Sales
  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="time")
  24.      */
  25.     private $time;
  26.     /**
  27.      * @ORM\Column(type="integer")
  28.      */
  29.     private $amount;
  30.     /**
  31.      * @ORM\Column(type="integer", nullable=true)
  32.      */
  33.     private $cashIn;
  34.     /**
  35.      * @ORM\Column(type="integer", nullable=true)
  36.      */
  37.     private $cashBack;
  38.     /**
  39.      * @ORM\ManyToOne(targetEntity=User::class, inversedBy="sales")
  40.      * @ORM\JoinColumn(nullable=false)
  41.      */
  42.     private $user;
  43.     /**
  44.      * @ORM\Column(type="boolean")
  45.      */
  46.     private $synch;
  47.     /**
  48.      * @ORM\Column(type="boolean")
  49.      */
  50.     private $payed;
  51.     /**
  52.      * @ORM\ManyToMany(targetEntity="Product", fetch="EAGER")
  53.      * @ORM\JoinTable(name="sale_items",
  54.      *      joinColumns={@ORM\JoinColumn(name="sale_id", referencedColumnName="id")},
  55.      *      inverseJoinColumns={@ORM\JoinColumn(name="product_id", referencedColumnName="id")}
  56.      *      )
  57.      */
  58.     private $saleItems;
  59.     /**
  60.      * @ORM\ManyToMany(targetEntity="Pack", fetch="EAGER")
  61.      * @ORM\JoinTable(name="sale_packs",
  62.      *      joinColumns={@ORM\JoinColumn(name="sale_id", referencedColumnName="id")},
  63.      *      inverseJoinColumns={@ORM\JoinColumn(name="pack_id", referencedColumnName="id")}
  64.      *      )
  65.      */
  66.     private $salePacks;
  67.     /**
  68.      * @ORM\ManyToOne(targetEntity=Shop::class, inversedBy="sales")
  69.      */
  70.     private $shop;
  71.     /**
  72.      * @ORM\Column(type="string", nullable=true)
  73.      */
  74.     private $bon;
  75.     /**
  76.      * @ORM\Column(type="string", length=255)
  77.      */
  78.     private $target;
  79.     /**
  80.      * @ORM\Column(type="boolean")
  81.      */
  82.     private $isSynch;
  83.     /**
  84.      * @ORM\Column(type="boolean")
  85.      */
  86.     private $deleted 0;
  87.     /**
  88.      * @ORM\Column(type="boolean")
  89.      */
  90.     private $error 0;
  91.     public function __construct()
  92.     {
  93.         $this->saleItems = new ArrayCollection();
  94.         $this->salePacks = new ArrayCollection();
  95.     }
  96.     public function getId(): ?int
  97.     {
  98.         return $this->id;
  99.     }
  100.     public function getDate(): ?\DateTimeInterface
  101.     {
  102.         return $this->date;
  103.     }
  104.     public function setDate(\DateTimeInterface $date): self
  105.     {
  106.         $this->date $date;
  107.         return $this;
  108.     }
  109.     public function getTime(): ?\DateTimeInterface
  110.     {
  111.         return $this->time;
  112.     }
  113.     public function setTime(\DateTimeInterface $time): self
  114.     {
  115.         $this->time $time;
  116.         return $this;
  117.     }
  118.     public function getAmount(): ?int
  119.     {
  120.         return $this->amount;
  121.     }
  122.     public function setAmount(int $amount): self
  123.     {
  124.         $this->amount $amount;
  125.         return $this;
  126.     }
  127.     public function getCashIn(): ?int
  128.     {
  129.         return $this->cashIn;
  130.     }
  131.     public function setCashIn(?int $cashIn): self
  132.     {
  133.         $this->cashIn $cashIn;
  134.         return $this;
  135.     }
  136.     public function getCashBack(): ?int
  137.     {
  138.         return $this->cashBack;
  139.     }
  140.     public function setCashBack(?int $cashBack): self
  141.     {
  142.         $this->cashBack $cashBack;
  143.         return $this;
  144.     }
  145.     public function getUser(): ?User
  146.     {
  147.         return $this->user;
  148.     }
  149.     public function setUser(?User $user): self
  150.     {
  151.         $this->user $user;
  152.         return $this;
  153.     }
  154.     public function isSynch(): ?bool
  155.     {
  156.         return $this->synch;
  157.     }
  158.     public function setSynch(bool $synch): self
  159.     {
  160.         $this->synch $synch;
  161.         return $this;
  162.     }
  163.     /**
  164.      * @return mixed
  165.      */
  166.     public function isPayed()
  167.     {
  168.         return $this->payed;
  169.     }
  170.     /**
  171.      * @param mixed $payed
  172.      */
  173.     public function setPayed($payed): void
  174.     {
  175.         $this->payed $payed;
  176.     }
  177.     /**
  178.      * @return Collection<int, SaleItems>
  179.      */
  180.     public function getSaleItems(): Collection
  181.     {
  182.         return $this->saleItems;
  183.     }
  184.     public function addSaleItem(SaleItems $saleItem): self
  185.     {
  186.         if (!$this->saleItems->contains($saleItem)) {
  187.             $this->saleItems[] = $saleItem;
  188.             $saleItem->setSale($this);
  189.         }
  190.         return $this;
  191.     }
  192.     public function removeSaleItem(SaleItems $saleItem): self
  193.     {
  194.         if ($this->saleItems->removeElement($saleItem)) {
  195.             // set the owning side to null (unless already changed)
  196.             if ($saleItem->getSale() === $this) {
  197.                 $saleItem->setSale(null);
  198.             }
  199.         }
  200.         return $this;
  201.     }
  202.     /**
  203.      * @return Collection<int, SalePacks>
  204.      */
  205.     public function getSalePacks(): Collection
  206.     {
  207.         return $this->salePacks;
  208.     }
  209.     public function addSalePacks(SalePacks $salePack): self
  210.     {
  211.         if (!$this->salePacks->contains($salePack)) {
  212.             $this->salePacks[] = $salePack;
  213.             $salePack->setSale($this);
  214.         }
  215.         return $this;
  216.     }
  217.     public function removeSalePacks(SalePacks $salePack): self
  218.     {
  219.         if ($this->salePacks->removeElement($salePack)) {
  220.             // set the owning side to null (unless already changed)
  221.             if ($salePack->getSale() === $this) {
  222.                 $salePack->setSale(null);
  223.             }
  224.         }
  225.         return $this;
  226.     }
  227.     /**
  228.      * @return mixed
  229.      */
  230.     public function getShop()
  231.     {
  232.         return $this->shop;
  233.     }
  234.     /**
  235.      * @param mixed $shop
  236.      */
  237.     public function setShop($shop): void
  238.     {
  239.         $this->shop $shop;
  240.     }
  241.     /**
  242.      * @return mixed
  243.      */
  244.     public function getBon()
  245.     {
  246.         return $this->bon;
  247.     }
  248.     /**
  249.      * @param mixed $bon
  250.      */
  251.     public function setBon($bon): void
  252.     {
  253.         $this->bon $bon;
  254.     }
  255.     /**
  256.      * @return mixed
  257.      */
  258.     public function getTarget()
  259.     {
  260.         return $this->target;
  261.     }
  262.     /**
  263.      * @param mixed $target
  264.      */
  265.     public function setTarget($target): void
  266.     {
  267.         $this->target $target;
  268.     }
  269.     /**
  270.      * @return mixed
  271.      */
  272.     public function getisSynch()
  273.     {
  274.         return $this->isSynch;
  275.     }
  276.     /**
  277.      * @param mixed $isSynch
  278.      */
  279.     public function setisSynch($isSynch): void
  280.     {
  281.         $this->isSynch $isSynch;
  282.     }
  283.     /**
  284.      * @return mixed
  285.      */
  286.     public function getDeleted()
  287.     {
  288.         return $this->deleted;
  289.     }
  290.     /**
  291.      * @param mixed $deleted
  292.      */
  293.     public function setDeleted($deleted): void
  294.     {
  295.         $this->deleted $deleted;
  296.     }
  297.     /**
  298.      * @return int
  299.      */
  300.     public function getError(): int
  301.     {
  302.         return $this->error;
  303.     }
  304.     /**
  305.      * @param int $error
  306.      */
  307.     public function setError(int $error): void
  308.     {
  309.         $this->error $error;
  310.     }
  311. }