src/Entity/Wire.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Entity\Club1895\TransactionWire as Club1895TransactionWire;
  4. use App\Entity\Traits\Timestampable;
  5. use App\Repository\WireRepository;
  6. use Doctrine\Common\Collections\ArrayCollection;
  7. use Doctrine\Common\Collections\Collection;
  8. use Doctrine\ORM\Mapping as ORM;
  9. #[ORM\Entity(repositoryClassWireRepository::class)]
  10. #[ORM\Table(name'payment_wire')]
  11. class Wire implements CancellableInterface
  12. {
  13.     use Timestampable;
  14.     #[ORM\Id]
  15.     #[ORM\GeneratedValue]
  16.     #[ORM\Column(type'integer')]
  17.     private $id;
  18.     #[ORM\Column(type'string'length255)]
  19.     private $number;
  20.     #[ORM\Column(type'float')]
  21.     private $amount;
  22.     #[ORM\Column(type'string'length255nullabletrue)]
  23.     private $bank;
  24.     #[ORM\Column(type'string'length255nullabletrue)]
  25.     private $drawer;
  26.     #[ORM\ManyToOne(targetEntityself::class, inversedBy'children')]
  27.     private $parent;
  28.     #[ORM\OneToMany(mappedBy'parent'targetEntityself::class)]
  29.     private $children;
  30.     #[ORM\OneToMany(mappedBy'wire'targetEntityTransactionWire::class)]
  31.     private $transactionWires;
  32.     #[ORM\Column(type'date_immutable'nullabletrue)]
  33.     private $date;
  34.     #[ORM\Column(type'boolean')]
  35.     private $isCancelled false;
  36.     #[ORM\OneToMany(mappedBy'wire'targetEntityBenefactorTransactionWire::class)]
  37.     private Collection $benefactorTransactionWires;
  38.     #[ORM\OneToMany(mappedBy'wire'targetEntityClub1895TransactionWire::class)]
  39.     private Collection $club1895TransactionWires;
  40.     public function __construct()
  41.     {
  42.         $this->children = new ArrayCollection();
  43.         $this->transactionWires = new ArrayCollection();
  44.         $this->benefactorTransactionWires = new ArrayCollection();
  45.         $this->club1895TransactionWires = new ArrayCollection();
  46.     }
  47.     public function getId(): ?int
  48.     {
  49.         return $this->id;
  50.     }
  51.     public function getBank(): ?string
  52.     {
  53.         return $this->bank;
  54.     }
  55.     public function setBank(?string $bank): self
  56.     {
  57.         $this->bank $bank;
  58.         return $this;
  59.     }
  60.     public function getDrawer(): ?string
  61.     {
  62.         return $this->drawer;
  63.     }
  64.     public function setDrawer(?string $drawer): self
  65.     {
  66.         $this->drawer $drawer;
  67.         return $this;
  68.     }
  69.     public function getAmount(): ?float
  70.     {
  71.         return $this->amount;
  72.     }
  73.     public function setAmount(float $amount): self
  74.     {
  75.         $this->amount $amount;
  76.         return $this;
  77.     }
  78.     public function getNumber(): ?string
  79.     {
  80.         return $this->number;
  81.     }
  82.     public function setNumber(string $number): self
  83.     {
  84.         $this->number $number;
  85.         return $this;
  86.     }
  87.     public function getParent(): ?self
  88.     {
  89.         return $this->parent;
  90.     }
  91.     public function setParent(?self $parent): self
  92.     {
  93.         $this->parent $parent;
  94.         return $this;
  95.     }
  96.     /**
  97.      * @return Collection<int, self>
  98.      */
  99.     public function getChildren(): Collection
  100.     {
  101.         return $this->children;
  102.     }
  103.     public function addChild(self $child): self
  104.     {
  105.         if (!$this->children->contains($child)) {
  106.             $this->children[] = $child;
  107.             $child->setParent($this);
  108.         }
  109.         return $this;
  110.     }
  111.     public function removeChild(self $child): self
  112.     {
  113.         if ($this->children->removeElement($child)) {
  114.             // set the owning side to null (unless already changed)
  115.             if ($child->getParent() === $this) {
  116.                 $child->setParent(null);
  117.             }
  118.         }
  119.         return $this;
  120.     }
  121.     /**
  122.      * @return Collection<int, TransactionWire>
  123.      */
  124.     public function getTransactionWires(): Collection
  125.     {
  126.         return $this->transactionWires;
  127.     }
  128.     public function addTransactionWire(TransactionWire $transactionWire): self
  129.     {
  130.         if (!$this->transactionWires->contains($transactionWire)) {
  131.             $this->transactionWires[] = $transactionWire;
  132.             $transactionWire->setWire($this);
  133.         }
  134.         return $this;
  135.     }
  136.     public function removeTransactionWire(TransactionWire $transactionWire): self
  137.     {
  138.         if ($this->transactionWires->removeElement($transactionWire)) {
  139.             // set the owning side to null (unless already changed)
  140.             if ($transactionWire->getWire() === $this) {
  141.                 $transactionWire->setWire(null);
  142.             }
  143.         }
  144.         return $this;
  145.     }
  146.     public function getDate(): ?\DateTimeImmutable
  147.     {
  148.         return $this->date;
  149.     }
  150.     public function setDate(?\DateTimeImmutable $date): self
  151.     {
  152.         $this->date $date;
  153.         return $this;
  154.     }
  155.     public function isIsCancelled(): ?bool
  156.     {
  157.         return $this->isCancelled;
  158.     }
  159.     public function setIsCancelled(bool $isCancelled): self
  160.     {
  161.         $this->isCancelled $isCancelled;
  162.         return $this;
  163.     }
  164.     public function getCancelReason(): ?string
  165.     {
  166.         $transaction $this->getTransactionWires()->first();
  167.         if ($transaction) {
  168.             return $transaction->getCancelReason();
  169.         }
  170.         return null;
  171.     }
  172.     /**
  173.      * @return Collection<int, BenefactorTransactionWire>
  174.      */
  175.     public function getBenefactorTransactionWires(): Collection
  176.     {
  177.         return $this->benefactorTransactionWires;
  178.     }
  179.     public function addBenefactorTransactionWire(BenefactorTransactionWire $benefactorTransactionWire): self
  180.     {
  181.         if (!$this->benefactorTransactionWires->contains($benefactorTransactionWire)) {
  182.             $this->benefactorTransactionWires->add($benefactorTransactionWire);
  183.             $benefactorTransactionWire->setWire($this);
  184.         }
  185.         return $this;
  186.     }
  187.     public function removeBenefactorTransactionWire(BenefactorTransactionWire $benefactorTransactionWire): self
  188.     {
  189.         if ($this->benefactorTransactionWires->removeElement($benefactorTransactionWire)) {
  190.             // set the owning side to null (unless already changed)
  191.             if ($benefactorTransactionWire->getWire() === $this) {
  192.                 $benefactorTransactionWire->setWire(null);
  193.             }
  194.         }
  195.         return $this;
  196.     }
  197.     /**
  198.      * @return Collection<int, TransactionWire>
  199.      */
  200.     public function getClub1895TransactionWires(): Collection
  201.     {
  202.         return $this->club1895TransactionWires;
  203.     }
  204.     public function addClub1895TransactionWire(TransactionWire $club1895TransactionWire): self
  205.     {
  206.         if (!$this->club1895TransactionWires->contains($club1895TransactionWire)) {
  207.             $this->club1895TransactionWires->add($club1895TransactionWire);
  208.             $club1895TransactionWire->setWire($this);
  209.         }
  210.         return $this;
  211.     }
  212.     public function removeClub1895TransactionWire(TransactionWire $club1895TransactionWire): self
  213.     {
  214.         if ($this->club1895TransactionWires->removeElement($club1895TransactionWire)) {
  215.             // set the owning side to null (unless already changed)
  216.             if ($club1895TransactionWire->getWire() === $this) {
  217.                 $club1895TransactionWire->setWire(null);
  218.             }
  219.         }
  220.         return $this;
  221.     }
  222. }