src/Entity/Cashbox.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\Common\Collections\Collection;
  5. use Doctrine\ORM\Mapping as ORM;
  6. /**
  7.  * @ORM\Entity(repositoryClass="App\Repository\CashboxRepository")
  8.  */
  9. class Cashbox
  10. {
  11.     /**
  12.      * @ORM\Id
  13.      * @ORM\Column(type="integer")
  14.      * @ORM\GeneratedValue(strategy="AUTO")
  15.      */
  16.     private $id;
  17.     /**
  18.      * @ORM\Column(type="string", length=255, nullable=true)
  19.      */
  20.     private $name;
  21.     /**
  22.      * @ORM\Column(type="text", nullable=true)
  23.      */
  24.     private $comment;
  25.     /**
  26.      * @ORM\Column(type="boolean", nullable=true)
  27.      */
  28.     private $locked;
  29.     /**
  30.      * @ORM\Column(type="string", length=255, nullable=true)
  31.      */
  32.     private $serial_number;
  33.     /**
  34.      * @ORM\OneToOne(targetEntity="App\Entity\FiskalyClient", mappedBy="cashbox")
  35.      */
  36.     private $fiskalyClient;
  37.     /**
  38.      * @ORM\OneToMany(targetEntity="App\Entity\Cart", mappedBy="cashbox")
  39.      */
  40.     private $carts;
  41.     /**
  42.      * @ORM\OneToMany(targetEntity="App\Entity\ReceiptCashbox", mappedBy="cashbox")
  43.      */
  44.     private $receiptCashboxes;
  45.     /**
  46.      * @ORM\OneToMany(targetEntity="App\Entity\CashboxDeposit", mappedBy="cashbox")
  47.      */
  48.     private $cashboxDeposits;
  49.     /**
  50.      * @ORM\OneToMany(targetEntity="App\Entity\CashboxWithdrawal", mappedBy="cashbox")
  51.      */
  52.     private $cashboxWithdrawals;
  53.     /**
  54.      * @ORM\OneToMany(targetEntity="App\Entity\CashboxPaymentToSupplier", mappedBy="cashbox")
  55.      */
  56.     private $cashboxPaymentToSuppliers;
  57.     /**
  58.      * @ORM\OneToMany(targetEntity="App\Entity\CashboxSession", mappedBy="cashbox")
  59.      */
  60.     private $cashboxSessions;
  61.     /**
  62.      * @ORM\OneToMany(targetEntity="App\Entity\DailyFinancialStatementCashbox", mappedBy="cashbox")
  63.      */
  64.     private $dailyFinancialStatementCashboxes;
  65.     /**
  66.      * @ORM\ManyToOne(targetEntity="App\Entity\Location", inversedBy="cashboxes")
  67.      * @ORM\JoinColumn(name="location_id", referencedColumnName="id")
  68.      */
  69.     private $location;
  70.     /**
  71.      * @ORM\ManyToMany(targetEntity="App\Entity\Employee", inversedBy="cashboxes")
  72.      * @ORM\JoinTable(
  73.      *     name="EmployeeToCashbox",
  74.      *     joinColumns={@ORM\JoinColumn(name="cashbox_id", referencedColumnName="id", nullable=false)},
  75.      *     inverseJoinColumns={@ORM\JoinColumn(name="employee_id", referencedColumnName="id", nullable=false)}
  76.      * )
  77.      */
  78.     private $employees;
  79.     public function __construct()
  80.     {
  81.         $this->carts = new ArrayCollection();
  82.         $this->receiptCashboxes = new ArrayCollection();
  83.         $this->cashboxDeposits = new ArrayCollection();
  84.         $this->cashboxWithdrawals = new ArrayCollection();
  85.         $this->cashboxPaymentToSuppliers = new ArrayCollection();
  86.         $this->cashboxSessions = new ArrayCollection();
  87.         $this->dailyFinancialStatementCashboxes = new ArrayCollection();
  88.         $this->employees = new ArrayCollection();
  89.     }
  90.     public function getId(): ?int
  91.     {
  92.         return $this->id;
  93.     }
  94.     public function getName(): ?string
  95.     {
  96.         return $this->name;
  97.     }
  98.     public function setName(?string $name): self
  99.     {
  100.         $this->name $name;
  101.         return $this;
  102.     }
  103.     public function getComment(): ?string
  104.     {
  105.         return $this->comment;
  106.     }
  107.     public function setComment(?string $comment): self
  108.     {
  109.         $this->comment $comment;
  110.         return $this;
  111.     }
  112.     public function getLocked(): ?bool
  113.     {
  114.         return $this->locked;
  115.     }
  116.     public function setLocked(?bool $locked): self
  117.     {
  118.         $this->locked $locked;
  119.         return $this;
  120.     }
  121.     public function getSerialNumber(): ?string
  122.     {
  123.         return $this->serial_number;
  124.     }
  125.     public function setSerialNumber(?string $serial_number): self
  126.     {
  127.         $this->serial_number $serial_number;
  128.         return $this;
  129.     }
  130.     public function getFiskalyClient(): ?FiskalyClient
  131.     {
  132.         return $this->fiskalyClient;
  133.     }
  134.     public function setFiskalyClient(?FiskalyClient $fiskalyClient): self
  135.     {
  136.         // unset the owning side of the relation if necessary
  137.         if ($fiskalyClient === null && $this->fiskalyClient !== null) {
  138.             $this->fiskalyClient->setCashbox(null);
  139.         }
  140.         // set the owning side of the relation if necessary
  141.         if ($fiskalyClient !== null && $fiskalyClient->getCashbox() !== $this) {
  142.             $fiskalyClient->setCashbox($this);
  143.         }
  144.         $this->fiskalyClient $fiskalyClient;
  145.         return $this;
  146.     }
  147.     /**
  148.      * @return Collection<int, Cart>
  149.      */
  150.     public function getCarts(): Collection
  151.     {
  152.         return $this->carts;
  153.     }
  154.     public function addCart(Cart $cart): self
  155.     {
  156.         if (!$this->carts->contains($cart)) {
  157.             $this->carts[] = $cart;
  158.             $cart->setCashbox($this);
  159.         }
  160.         return $this;
  161.     }
  162.     public function removeCart(Cart $cart): self
  163.     {
  164.         if ($this->carts->removeElement($cart)) {
  165.             // set the owning side to null (unless already changed)
  166.             if ($cart->getCashbox() === $this) {
  167.                 $cart->setCashbox(null);
  168.             }
  169.         }
  170.         return $this;
  171.     }
  172.     /**
  173.      * @return Collection<int, ReceiptCashbox>
  174.      */
  175.     public function getReceiptCashboxes(): Collection
  176.     {
  177.         return $this->receiptCashboxes;
  178.     }
  179.     public function addReceiptCashbox(ReceiptCashbox $receiptCashbox): self
  180.     {
  181.         if (!$this->receiptCashboxes->contains($receiptCashbox)) {
  182.             $this->receiptCashboxes[] = $receiptCashbox;
  183.             $receiptCashbox->setCashbox($this);
  184.         }
  185.         return $this;
  186.     }
  187.     public function removeReceiptCashbox(ReceiptCashbox $receiptCashbox): self
  188.     {
  189.         if ($this->receiptCashboxes->removeElement($receiptCashbox)) {
  190.             // set the owning side to null (unless already changed)
  191.             if ($receiptCashbox->getCashbox() === $this) {
  192.                 $receiptCashbox->setCashbox(null);
  193.             }
  194.         }
  195.         return $this;
  196.     }
  197.     /**
  198.      * @return Collection<int, CashboxDeposit>
  199.      */
  200.     public function getCashboxDeposits(): Collection
  201.     {
  202.         return $this->cashboxDeposits;
  203.     }
  204.     public function addCashboxDeposit(CashboxDeposit $cashboxDeposit): self
  205.     {
  206.         if (!$this->cashboxDeposits->contains($cashboxDeposit)) {
  207.             $this->cashboxDeposits[] = $cashboxDeposit;
  208.             $cashboxDeposit->setCashbox($this);
  209.         }
  210.         return $this;
  211.     }
  212.     public function removeCashboxDeposit(CashboxDeposit $cashboxDeposit): self
  213.     {
  214.         if ($this->cashboxDeposits->removeElement($cashboxDeposit)) {
  215.             // set the owning side to null (unless already changed)
  216.             if ($cashboxDeposit->getCashbox() === $this) {
  217.                 $cashboxDeposit->setCashbox(null);
  218.             }
  219.         }
  220.         return $this;
  221.     }
  222.     /**
  223.      * @return Collection<int, CashboxWithdrawal>
  224.      */
  225.     public function getCashboxWithdrawals(): Collection
  226.     {
  227.         return $this->cashboxWithdrawals;
  228.     }
  229.     public function addCashboxWithdrawal(CashboxWithdrawal $cashboxWithdrawal): self
  230.     {
  231.         if (!$this->cashboxWithdrawals->contains($cashboxWithdrawal)) {
  232.             $this->cashboxWithdrawals[] = $cashboxWithdrawal;
  233.             $cashboxWithdrawal->setCashbox($this);
  234.         }
  235.         return $this;
  236.     }
  237.     public function removeCashboxWithdrawal(CashboxWithdrawal $cashboxWithdrawal): self
  238.     {
  239.         if ($this->cashboxWithdrawals->removeElement($cashboxWithdrawal)) {
  240.             // set the owning side to null (unless already changed)
  241.             if ($cashboxWithdrawal->getCashbox() === $this) {
  242.                 $cashboxWithdrawal->setCashbox(null);
  243.             }
  244.         }
  245.         return $this;
  246.     }
  247.     /**
  248.      * @return Collection<int, CashboxPaymentToSupplier>
  249.      */
  250.     public function getCashboxPaymentToSuppliers(): Collection
  251.     {
  252.         return $this->cashboxPaymentToSuppliers;
  253.     }
  254.     public function addCashboxPaymentToSupplier(CashboxPaymentToSupplier $cashboxPaymentToSupplier): self
  255.     {
  256.         if (!$this->cashboxPaymentToSuppliers->contains($cashboxPaymentToSupplier)) {
  257.             $this->cashboxPaymentToSuppliers[] = $cashboxPaymentToSupplier;
  258.             $cashboxPaymentToSupplier->setCashbox($this);
  259.         }
  260.         return $this;
  261.     }
  262.     public function removeCashboxPaymentToSupplier(CashboxPaymentToSupplier $cashboxPaymentToSupplier): self
  263.     {
  264.         if ($this->cashboxPaymentToSuppliers->removeElement($cashboxPaymentToSupplier)) {
  265.             // set the owning side to null (unless already changed)
  266.             if ($cashboxPaymentToSupplier->getCashbox() === $this) {
  267.                 $cashboxPaymentToSupplier->setCashbox(null);
  268.             }
  269.         }
  270.         return $this;
  271.     }
  272.     /**
  273.      * @return Collection<int, CashboxSession>
  274.      */
  275.     public function getCashboxSessions(): Collection
  276.     {
  277.         return $this->cashboxSessions;
  278.     }
  279.     public function addCashboxSession(CashboxSession $cashboxSession): self
  280.     {
  281.         if (!$this->cashboxSessions->contains($cashboxSession)) {
  282.             $this->cashboxSessions[] = $cashboxSession;
  283.             $cashboxSession->setCashbox($this);
  284.         }
  285.         return $this;
  286.     }
  287.     public function removeCashboxSession(CashboxSession $cashboxSession): self
  288.     {
  289.         if ($this->cashboxSessions->removeElement($cashboxSession)) {
  290.             // set the owning side to null (unless already changed)
  291.             if ($cashboxSession->getCashbox() === $this) {
  292.                 $cashboxSession->setCashbox(null);
  293.             }
  294.         }
  295.         return $this;
  296.     }
  297.     /**
  298.      * @return Collection<int, DailyFinancialStatementCashbox>
  299.      */
  300.     public function getDailyFinancialStatementCashboxes(): Collection
  301.     {
  302.         return $this->dailyFinancialStatementCashboxes;
  303.     }
  304.     public function addDailyFinancialStatementCashbox(DailyFinancialStatementCashbox $dailyFinancialStatementCashbox): self
  305.     {
  306.         if (!$this->dailyFinancialStatementCashboxes->contains($dailyFinancialStatementCashbox)) {
  307.             $this->dailyFinancialStatementCashboxes[] = $dailyFinancialStatementCashbox;
  308.             $dailyFinancialStatementCashbox->setCashbox($this);
  309.         }
  310.         return $this;
  311.     }
  312.     public function removeDailyFinancialStatementCashbox(DailyFinancialStatementCashbox $dailyFinancialStatementCashbox): self
  313.     {
  314.         if ($this->dailyFinancialStatementCashboxes->removeElement($dailyFinancialStatementCashbox)) {
  315.             // set the owning side to null (unless already changed)
  316.             if ($dailyFinancialStatementCashbox->getCashbox() === $this) {
  317.                 $dailyFinancialStatementCashbox->setCashbox(null);
  318.             }
  319.         }
  320.         return $this;
  321.     }
  322.     public function getLocation(): ?Location
  323.     {
  324.         return $this->location;
  325.     }
  326.     public function setLocation(?Location $location): self
  327.     {
  328.         $this->location $location;
  329.         return $this;
  330.     }
  331.     /**
  332.      * @return Collection<int, Employee>
  333.      */
  334.     public function getEmployees(): Collection
  335.     {
  336.         return $this->employees;
  337.     }
  338.     public function addEmployee(Employee $employee): self
  339.     {
  340.         if (!$this->employees->contains($employee)) {
  341.             $this->employees[] = $employee;
  342.         }
  343.         return $this;
  344.     }
  345.     public function removeEmployee(Employee $employee): self
  346.     {
  347.         $this->employees->removeElement($employee);
  348.         return $this;
  349.     }
  350. }