<?php
namespace App\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass="App\Repository\CashboxRepository")
*/
class Cashbox
{
/**
* @ORM\Id
* @ORM\Column(type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $name;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $comment;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $locked;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $serial_number;
/**
* @ORM\OneToOne(targetEntity="App\Entity\FiskalyClient", mappedBy="cashbox")
*/
private $fiskalyClient;
/**
* @ORM\OneToMany(targetEntity="App\Entity\Cart", mappedBy="cashbox")
*/
private $carts;
/**
* @ORM\OneToMany(targetEntity="App\Entity\ReceiptCashbox", mappedBy="cashbox")
*/
private $receiptCashboxes;
/**
* @ORM\OneToMany(targetEntity="App\Entity\CashboxDeposit", mappedBy="cashbox")
*/
private $cashboxDeposits;
/**
* @ORM\OneToMany(targetEntity="App\Entity\CashboxWithdrawal", mappedBy="cashbox")
*/
private $cashboxWithdrawals;
/**
* @ORM\OneToMany(targetEntity="App\Entity\CashboxPaymentToSupplier", mappedBy="cashbox")
*/
private $cashboxPaymentToSuppliers;
/**
* @ORM\OneToMany(targetEntity="App\Entity\CashboxSession", mappedBy="cashbox")
*/
private $cashboxSessions;
/**
* @ORM\OneToMany(targetEntity="App\Entity\DailyFinancialStatementCashbox", mappedBy="cashbox")
*/
private $dailyFinancialStatementCashboxes;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Location", inversedBy="cashboxes")
* @ORM\JoinColumn(name="location_id", referencedColumnName="id")
*/
private $location;
/**
* @ORM\ManyToMany(targetEntity="App\Entity\Employee", inversedBy="cashboxes")
* @ORM\JoinTable(
* name="EmployeeToCashbox",
* joinColumns={@ORM\JoinColumn(name="cashbox_id", referencedColumnName="id", nullable=false)},
* inverseJoinColumns={@ORM\JoinColumn(name="employee_id", referencedColumnName="id", nullable=false)}
* )
*/
private $employees;
public function __construct()
{
$this->carts = new ArrayCollection();
$this->receiptCashboxes = new ArrayCollection();
$this->cashboxDeposits = new ArrayCollection();
$this->cashboxWithdrawals = new ArrayCollection();
$this->cashboxPaymentToSuppliers = new ArrayCollection();
$this->cashboxSessions = new ArrayCollection();
$this->dailyFinancialStatementCashboxes = new ArrayCollection();
$this->employees = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(?string $name): self
{
$this->name = $name;
return $this;
}
public function getComment(): ?string
{
return $this->comment;
}
public function setComment(?string $comment): self
{
$this->comment = $comment;
return $this;
}
public function getLocked(): ?bool
{
return $this->locked;
}
public function setLocked(?bool $locked): self
{
$this->locked = $locked;
return $this;
}
public function getSerialNumber(): ?string
{
return $this->serial_number;
}
public function setSerialNumber(?string $serial_number): self
{
$this->serial_number = $serial_number;
return $this;
}
public function getFiskalyClient(): ?FiskalyClient
{
return $this->fiskalyClient;
}
public function setFiskalyClient(?FiskalyClient $fiskalyClient): self
{
// unset the owning side of the relation if necessary
if ($fiskalyClient === null && $this->fiskalyClient !== null) {
$this->fiskalyClient->setCashbox(null);
}
// set the owning side of the relation if necessary
if ($fiskalyClient !== null && $fiskalyClient->getCashbox() !== $this) {
$fiskalyClient->setCashbox($this);
}
$this->fiskalyClient = $fiskalyClient;
return $this;
}
/**
* @return Collection<int, Cart>
*/
public function getCarts(): Collection
{
return $this->carts;
}
public function addCart(Cart $cart): self
{
if (!$this->carts->contains($cart)) {
$this->carts[] = $cart;
$cart->setCashbox($this);
}
return $this;
}
public function removeCart(Cart $cart): self
{
if ($this->carts->removeElement($cart)) {
// set the owning side to null (unless already changed)
if ($cart->getCashbox() === $this) {
$cart->setCashbox(null);
}
}
return $this;
}
/**
* @return Collection<int, ReceiptCashbox>
*/
public function getReceiptCashboxes(): Collection
{
return $this->receiptCashboxes;
}
public function addReceiptCashbox(ReceiptCashbox $receiptCashbox): self
{
if (!$this->receiptCashboxes->contains($receiptCashbox)) {
$this->receiptCashboxes[] = $receiptCashbox;
$receiptCashbox->setCashbox($this);
}
return $this;
}
public function removeReceiptCashbox(ReceiptCashbox $receiptCashbox): self
{
if ($this->receiptCashboxes->removeElement($receiptCashbox)) {
// set the owning side to null (unless already changed)
if ($receiptCashbox->getCashbox() === $this) {
$receiptCashbox->setCashbox(null);
}
}
return $this;
}
/**
* @return Collection<int, CashboxDeposit>
*/
public function getCashboxDeposits(): Collection
{
return $this->cashboxDeposits;
}
public function addCashboxDeposit(CashboxDeposit $cashboxDeposit): self
{
if (!$this->cashboxDeposits->contains($cashboxDeposit)) {
$this->cashboxDeposits[] = $cashboxDeposit;
$cashboxDeposit->setCashbox($this);
}
return $this;
}
public function removeCashboxDeposit(CashboxDeposit $cashboxDeposit): self
{
if ($this->cashboxDeposits->removeElement($cashboxDeposit)) {
// set the owning side to null (unless already changed)
if ($cashboxDeposit->getCashbox() === $this) {
$cashboxDeposit->setCashbox(null);
}
}
return $this;
}
/**
* @return Collection<int, CashboxWithdrawal>
*/
public function getCashboxWithdrawals(): Collection
{
return $this->cashboxWithdrawals;
}
public function addCashboxWithdrawal(CashboxWithdrawal $cashboxWithdrawal): self
{
if (!$this->cashboxWithdrawals->contains($cashboxWithdrawal)) {
$this->cashboxWithdrawals[] = $cashboxWithdrawal;
$cashboxWithdrawal->setCashbox($this);
}
return $this;
}
public function removeCashboxWithdrawal(CashboxWithdrawal $cashboxWithdrawal): self
{
if ($this->cashboxWithdrawals->removeElement($cashboxWithdrawal)) {
// set the owning side to null (unless already changed)
if ($cashboxWithdrawal->getCashbox() === $this) {
$cashboxWithdrawal->setCashbox(null);
}
}
return $this;
}
/**
* @return Collection<int, CashboxPaymentToSupplier>
*/
public function getCashboxPaymentToSuppliers(): Collection
{
return $this->cashboxPaymentToSuppliers;
}
public function addCashboxPaymentToSupplier(CashboxPaymentToSupplier $cashboxPaymentToSupplier): self
{
if (!$this->cashboxPaymentToSuppliers->contains($cashboxPaymentToSupplier)) {
$this->cashboxPaymentToSuppliers[] = $cashboxPaymentToSupplier;
$cashboxPaymentToSupplier->setCashbox($this);
}
return $this;
}
public function removeCashboxPaymentToSupplier(CashboxPaymentToSupplier $cashboxPaymentToSupplier): self
{
if ($this->cashboxPaymentToSuppliers->removeElement($cashboxPaymentToSupplier)) {
// set the owning side to null (unless already changed)
if ($cashboxPaymentToSupplier->getCashbox() === $this) {
$cashboxPaymentToSupplier->setCashbox(null);
}
}
return $this;
}
/**
* @return Collection<int, CashboxSession>
*/
public function getCashboxSessions(): Collection
{
return $this->cashboxSessions;
}
public function addCashboxSession(CashboxSession $cashboxSession): self
{
if (!$this->cashboxSessions->contains($cashboxSession)) {
$this->cashboxSessions[] = $cashboxSession;
$cashboxSession->setCashbox($this);
}
return $this;
}
public function removeCashboxSession(CashboxSession $cashboxSession): self
{
if ($this->cashboxSessions->removeElement($cashboxSession)) {
// set the owning side to null (unless already changed)
if ($cashboxSession->getCashbox() === $this) {
$cashboxSession->setCashbox(null);
}
}
return $this;
}
/**
* @return Collection<int, DailyFinancialStatementCashbox>
*/
public function getDailyFinancialStatementCashboxes(): Collection
{
return $this->dailyFinancialStatementCashboxes;
}
public function addDailyFinancialStatementCashbox(DailyFinancialStatementCashbox $dailyFinancialStatementCashbox): self
{
if (!$this->dailyFinancialStatementCashboxes->contains($dailyFinancialStatementCashbox)) {
$this->dailyFinancialStatementCashboxes[] = $dailyFinancialStatementCashbox;
$dailyFinancialStatementCashbox->setCashbox($this);
}
return $this;
}
public function removeDailyFinancialStatementCashbox(DailyFinancialStatementCashbox $dailyFinancialStatementCashbox): self
{
if ($this->dailyFinancialStatementCashboxes->removeElement($dailyFinancialStatementCashbox)) {
// set the owning side to null (unless already changed)
if ($dailyFinancialStatementCashbox->getCashbox() === $this) {
$dailyFinancialStatementCashbox->setCashbox(null);
}
}
return $this;
}
public function getLocation(): ?Location
{
return $this->location;
}
public function setLocation(?Location $location): self
{
$this->location = $location;
return $this;
}
/**
* @return Collection<int, Employee>
*/
public function getEmployees(): Collection
{
return $this->employees;
}
public function addEmployee(Employee $employee): self
{
if (!$this->employees->contains($employee)) {
$this->employees[] = $employee;
}
return $this;
}
public function removeEmployee(Employee $employee): self
{
$this->employees->removeElement($employee);
return $this;
}
}