Relate accountings to tipjars

This commit is contained in:
2024-04-22 12:14:08 +02:00
parent d7a67eaea6
commit 95323f658b
+23
View File
@@ -47,6 +47,9 @@ class Accounting
#[ORM\OneToOne(mappedBy: 'accounting', cascade: ['persist', 'remove'])]
private ?Project $project = null;
#[ORM\OneToOne(mappedBy: 'accounting', cascade: ['persist', 'remove'])]
private ?Tipjar $tipjar = null;
public function __construct()
{
/**
@@ -168,4 +171,24 @@ class Accounting
return $this;
}
public function getTipjar(): ?Tipjar
{
return $this->tipjar;
}
public function setTipjar(Tipjar $tipjar): static
{
// set the owning side of the relation if necessary
if ($tipjar->getAccounting() !== $this) {
$tipjar->setAccounting($this);
}
// set the owner class
$this->setOwnerClass($tipjar::class);
$this->tipjar = $tipjar;
return $this;
}
}