src/Entity/CashOutType.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Entity\Traits\ToStringNameTrait;
  4. use App\Repository\CashOutTypeRepository;
  5. use Doctrine\Common\Collections\ArrayCollection;
  6. use Doctrine\Common\Collections\Collection;
  7. use Doctrine\ORM\Mapping as ORM;
  8. /**
  9.  * @ORM\Entity(repositoryClass=CashOutTypeRepository::class)
  10.  */
  11. class CashOutType
  12. {
  13.     use ToStringNameTrait;
  14.     /**
  15.      * @ORM\Id
  16.      * @ORM\GeneratedValue
  17.      * @ORM\Column(type="integer")
  18.      */
  19.     private $id;
  20.     /**
  21.      * @ORM\Column(type="string", length=255)
  22.      */
  23.     private $name;
  24.     /**
  25.      * @ORM\Column(type="boolean", nullable=true, options={"default":false})
  26.      */
  27.     private $deleted;
  28.     /**
  29.      * @ORM\Column(type="boolean", nullable=true, options={"default":false})
  30.      */
  31.     private $deletable;
  32.     /**
  33.      * @ORM\Column(type="decimal", precision=10, scale=2, nullable=true)
  34.      */
  35.     private $value;
  36.     /**
  37.      * @ORM\Column(type="boolean", nullable=true, options={"default":false})
  38.      */
  39.     private $fixed;
  40.     /**
  41.      * @ORM\Column(type="boolean", nullable=true, options={"default":false})
  42.      */
  43.     private $cash_out_deletable;
  44.     /**
  45.      * @ORM\OneToMany(targetEntity=CashOut::class, mappedBy="cashOutType")
  46.      */
  47.     private $cashOuts;
  48.     public function __construct()
  49.     {
  50.         $this->cashOuts = new ArrayCollection();
  51.     }
  52.     public function getId(): ?int
  53.     {
  54.         return $this->id;
  55.     }
  56.     public function getName(): ?string
  57.     {
  58.         return $this->name;
  59.     }
  60.     public function setName(string $name): self
  61.     {
  62.         $this->name $name;
  63.         return $this;
  64.     }
  65.     public function isDeleted(): ?bool
  66.     {
  67.         return $this->deleted;
  68.     }
  69.     public function setDeleted(?bool $deleted): self
  70.     {
  71.         $this->deleted $deleted;
  72.         return $this;
  73.     }
  74.     public function isDeletable(): ?bool
  75.     {
  76.         return $this->deletable;
  77.     }
  78.     public function setDeletable(?bool $deletable): self
  79.     {
  80.         $this->deletable $deletable;
  81.         return $this;
  82.     }
  83.     public function getValue(): ?string
  84.     {
  85.         return $this->value;
  86.     }
  87.     public function setValue(?string $value): self
  88.     {
  89.         $this->value $value;
  90.         return $this;
  91.     }
  92.     public function isFixed(): ?bool
  93.     {
  94.         return $this->fixed;
  95.     }
  96.     public function setFixed(?bool $fixed): self
  97.     {
  98.         $this->fixed $fixed;
  99.         return $this;
  100.     }
  101.     public function isCashOutDeletable(): ?bool
  102.     {
  103.         return $this->cash_out_deletable;
  104.     }
  105.     public function setCashOutDeletable(?bool $cash_out_deletable): self
  106.     {
  107.         $this->cash_out_deletable $cash_out_deletable;
  108.         return $this;
  109.     }
  110.     /**
  111.      * @return Collection<int, CashOut>
  112.      */
  113.     public function getCashOuts(): Collection
  114.     {
  115.         return $this->cashOuts;
  116.     }
  117.     public function addCashOut(CashOut $cashOut): self
  118.     {
  119.         if (!$this->cashOuts->contains($cashOut)) {
  120.             $this->cashOuts[] = $cashOut;
  121.             $cashOut->setCashOutType($this);
  122.         }
  123.         return $this;
  124.     }
  125.     public function removeCashOut(CashOut $cashOut): self
  126.     {
  127.         if ($this->cashOuts->removeElement($cashOut)) {
  128.             // set the owning side to null (unless already changed)
  129.             if ($cashOut->getCashOutType() === $this) {
  130.                 $cashOut->setCashOutType(null);
  131.             }
  132.         }
  133.         return $this;
  134.     }
  135. }