<?php
namespace App\Entity;
use App\Entity\Traits\ToStringNameTrait;
use App\Repository\CashOutTypeRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=CashOutTypeRepository::class)
*/
class CashOutType
{
use ToStringNameTrait;
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255)
*/
private $name;
/**
* @ORM\Column(type="boolean", nullable=true, options={"default":false})
*/
private $deleted;
/**
* @ORM\Column(type="boolean", nullable=true, options={"default":false})
*/
private $deletable;
/**
* @ORM\Column(type="decimal", precision=10, scale=2, nullable=true)
*/
private $value;
/**
* @ORM\Column(type="boolean", nullable=true, options={"default":false})
*/
private $fixed;
/**
* @ORM\Column(type="boolean", nullable=true, options={"default":false})
*/
private $cash_out_deletable;
/**
* @ORM\OneToMany(targetEntity=CashOut::class, mappedBy="cashOutType")
*/
private $cashOuts;
public function __construct()
{
$this->cashOuts = 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 isDeleted(): ?bool
{
return $this->deleted;
}
public function setDeleted(?bool $deleted): self
{
$this->deleted = $deleted;
return $this;
}
public function isDeletable(): ?bool
{
return $this->deletable;
}
public function setDeletable(?bool $deletable): self
{
$this->deletable = $deletable;
return $this;
}
public function getValue(): ?string
{
return $this->value;
}
public function setValue(?string $value): self
{
$this->value = $value;
return $this;
}
public function isFixed(): ?bool
{
return $this->fixed;
}
public function setFixed(?bool $fixed): self
{
$this->fixed = $fixed;
return $this;
}
public function isCashOutDeletable(): ?bool
{
return $this->cash_out_deletable;
}
public function setCashOutDeletable(?bool $cash_out_deletable): self
{
$this->cash_out_deletable = $cash_out_deletable;
return $this;
}
/**
* @return Collection<int, CashOut>
*/
public function getCashOuts(): Collection
{
return $this->cashOuts;
}
public function addCashOut(CashOut $cashOut): self
{
if (!$this->cashOuts->contains($cashOut)) {
$this->cashOuts[] = $cashOut;
$cashOut->setCashOutType($this);
}
return $this;
}
public function removeCashOut(CashOut $cashOut): self
{
if ($this->cashOuts->removeElement($cashOut)) {
// set the owning side to null (unless already changed)
if ($cashOut->getCashOutType() === $this) {
$cashOut->setCashOutType(null);
}
}
return $this;
}
}