diff --git a/src/Entity/Accounting.php b/src/Entity/Accounting.php index 114f896..e5c8f4a 100644 --- a/src/Entity/Accounting.php +++ b/src/Entity/Accounting.php @@ -32,18 +32,18 @@ class Accounting #[ORM\Column(length: 3)] private ?string $currency = null; - #[API\ApiProperty(writable: false)] - #[ORM\OneToMany(mappedBy: 'target', targetEntity: Transaction::class)] - private Collection $transactionsReceived; - #[API\ApiProperty(writable: false)] #[ORM\OneToMany(mappedBy: 'origin', targetEntity: Transaction::class)] private Collection $transactionsIssued; + #[API\ApiProperty(writable: false)] + #[ORM\OneToMany(mappedBy: 'target', targetEntity: Transaction::class)] + private Collection $transactionsReceived; + public function __construct() { - $this->transactionsReceived = new ArrayCollection(); $this->transactionsIssued = new ArrayCollection(); + $this->transactionsReceived = new ArrayCollection(); } public function getId(): ?int @@ -63,36 +63,6 @@ class Accounting return $this; } - /** - * @return Collection - */ - public function getTransactionsReceived(): Collection - { - return $this->transactionsReceived; - } - - public function addTransactionsReceived(Transaction $transactionsReceived): static - { - if (!$this->transactionsReceived->contains($transactionsReceived)) { - $this->transactionsReceived->add($transactionsReceived); - $transactionsReceived->setTarget($this); - } - - return $this; - } - - public function removeTransactionsReceived(Transaction $transactionsReceived): static - { - if ($this->transactionsReceived->removeElement($transactionsReceived)) { - // set the owning side to null (unless already changed) - if ($transactionsReceived->getTarget() === $this) { - $transactionsReceived->setTarget(null); - } - } - - return $this; - } - /** * @return Collection */ @@ -122,4 +92,34 @@ class Accounting return $this; } + + /** + * @return Collection + */ + public function getTransactionsReceived(): Collection + { + return $this->transactionsReceived; + } + + public function addTransactionsReceived(Transaction $transactionsReceived): static + { + if (!$this->transactionsReceived->contains($transactionsReceived)) { + $this->transactionsReceived->add($transactionsReceived); + $transactionsReceived->setTarget($this); + } + + return $this; + } + + public function removeTransactionsReceived(Transaction $transactionsReceived): static + { + if ($this->transactionsReceived->removeElement($transactionsReceived)) { + // set the owning side to null (unless already changed) + if ($transactionsReceived->getTarget() === $this) { + $transactionsReceived->setTarget(null); + } + } + + return $this; + } }