Relate accountings to tipjars
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user