not sure what I did here

This commit is contained in:
2024-12-22 01:18:32 +00:00
parent ba28fcca08
commit 0c902b93c4
3 changed files with 186 additions and 17 deletions

View File

@ -91,10 +91,31 @@ class MemberCase
#[ORM\OneToMany(targetEntity: Referral::class, mappedBy: 'memberCase', orphanRemoval: true)]
private Collection $referrals;
/**
* @var Collection<int, MonthlyCaseNote>
*/
#[ORM\OneToMany(targetEntity: MonthlyCaseNote::class, mappedBy: 'memberCase')]
private Collection $monthlyCaseNotes;
/**
* @var Collection<int, Member>
*/
#[ORM\OneToMany(targetEntity: Member::class, mappedBy: 'memberCase', orphanRemoval: true)]
private Collection $members;
/**
* @var Collection<int, StaffNote>
*/
#[ORM\OneToMany(targetEntity: StaffNote::class, mappedBy: 'memberCase')]
private Collection $staffNotes;
public function __construct()
{
$this->userCases = new ArrayCollection();
$this->referrals = new ArrayCollection();
$this->monthlyCaseNotes = new ArrayCollection();
$this->members = new ArrayCollection();
$this->staffNotes = new ArrayCollection();
}
public function getId(): ?Uuid
@ -394,4 +415,94 @@ class MemberCase
return $this;
}
/**
* @return Collection<int, MonthlyCaseNote>
*/
public function getMonthlyCaseNotes(): Collection
{
return $this->monthlyCaseNotes;
}
public function addMonthlyCaseNote(MonthlyCaseNote $monthlyCaseNote): static
{
if (!$this->monthlyCaseNotes->contains($monthlyCaseNote)) {
$this->monthlyCaseNotes->add($monthlyCaseNote);
$monthlyCaseNote->setMemberCase($this);
}
return $this;
}
public function removeMonthlyCaseNote(MonthlyCaseNote $monthlyCaseNote): static
{
if ($this->monthlyCaseNotes->removeElement($monthlyCaseNote)) {
// set the owning side to null (unless already changed)
if ($monthlyCaseNote->getMemberCase() === $this) {
$monthlyCaseNote->setMemberCase(null);
}
}
return $this;
}
/**
* @return Collection<int, Member>
*/
public function getMembers(): Collection
{
return $this->members;
}
public function addMember(Member $member): static
{
if (!$this->members->contains($member)) {
$this->members->add($member);
$member->setCaseId($this);
}
return $this;
}
public function removeMember(Member $member): static
{
if ($this->members->removeElement($member)) {
// set the owning side to null (unless already changed)
if ($member->getCaseId() === $this) {
$member->setCaseId(null);
}
}
return $this;
}
/**
* @return Collection<int, StaffNote>
*/
public function getStaffNotes(): Collection
{
return $this->staffNotes;
}
public function addStaffNote(StaffNote $staffNote): static
{
if (!$this->staffNotes->contains($staffNote)) {
$this->staffNotes->add($staffNote);
$staffNote->setMemberCase($this);
}
return $this;
}
public function removeStaffNote(StaffNote $staffNote): static
{
if ($this->staffNotes->removeElement($staffNote)) {
// set the owning side to null (unless already changed)
if ($staffNote->getMemberCase() === $this) {
$staffNote->setMemberCase(null);
}
}
return $this;
}
}