Add getAssociated method to AbstractPersonResource

- Introduced `getAssociated` method to retrieve either `Person`, `ThirdParty`, or `null`.
- Provides a unified accessor combining `person` and `thirdParty` properties.
This commit is contained in:
2026-02-26 14:14:00 +01:00
parent 8c88fca2ee
commit 1d4d90e48a

View File

@@ -180,6 +180,11 @@ class AbstractPersonResource implements TrackCreationInterface, TrackUpdateInter
return $this;
}
public function getAssociated(): Person|ThirdParty|null
{
return $this->person ?? $this->thirdParty;
}
/**
* @Assert\Callback
*/