Update order of transactions in accounting
This commit is contained in:
+35
-35
@@ -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<int, Transaction>
|
||||
*/
|
||||
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<int, Transaction>
|
||||
*/
|
||||
@@ -122,4 +92,34 @@ class Accounting
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Collection<int, Transaction>
|
||||
*/
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user