From 1d4d90e48a7d7f5ba099601232e334e72618e6cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Thu, 26 Feb 2026 14:14:00 +0100 Subject: [PATCH] Add `getAssociated` method to `AbstractPersonResource` - Introduced `getAssociated` method to retrieve either `Person`, `ThirdParty`, or `null`. - Provides a unified accessor combining `person` and `thirdParty` properties. --- .../Entity/Person/AbstractPersonResource.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Bundle/ChillPersonBundle/Entity/Person/AbstractPersonResource.php b/src/Bundle/ChillPersonBundle/Entity/Person/AbstractPersonResource.php index cfdf88555..75f4b66c9 100644 --- a/src/Bundle/ChillPersonBundle/Entity/Person/AbstractPersonResource.php +++ b/src/Bundle/ChillPersonBundle/Entity/Person/AbstractPersonResource.php @@ -180,6 +180,11 @@ class AbstractPersonResource implements TrackCreationInterface, TrackUpdateInter return $this; } + public function getAssociated(): Person|ThirdParty|null + { + return $this->person ?? $this->thirdParty; + } + /** * @Assert\Callback */