From: Vincent Vanwaelscappel Date: Thu, 19 May 2022 17:59:57 +0000 (+0200) Subject: wip #4285 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=f1664eb2b07ef8ec666599940575aa1664149fbb;p=cubist_cms-back.git wip #4285 --- diff --git a/src/app/Magic/Fields/BunchOfFieldsMultiple.php b/src/app/Magic/Fields/BunchOfFieldsMultiple.php index 309e4e8..3593b56 100644 --- a/src/app/Magic/Fields/BunchOfFieldsMultiple.php +++ b/src/app/Magic/Fields/BunchOfFieldsMultiple.php @@ -49,7 +49,9 @@ class BunchOfFieldsMultiple extends BunchOfFields implements InterfaceBunchOfFie } if (is_string($bunch)) { if (class_exists($bunch)) { + /** @var InterfaceBunchOfFields $bunchInstance */ $bunchInstance = new $bunch(); + $bunchInstance->setRootEntry($this->getRootEntry()); if (method_exists($bunchInstance, 'getFields')) { $this->_fields = $bunchInstance->getFields(); } diff --git a/src/app/Magic/InterfaceBunchOfFields.php b/src/app/Magic/InterfaceBunchOfFields.php index 851f5b0..425a6d0 100644 --- a/src/app/Magic/InterfaceBunchOfFields.php +++ b/src/app/Magic/InterfaceBunchOfFields.php @@ -37,4 +37,14 @@ interface InterfaceBunchOfFields * @return bool */ public function hasField($name): bool; + + /** + * @return InterfaceBunchOfFields + */ + public function getRootEntry(): ?InterfaceBunchOfFields; + + /** + * @param InterfaceBunchOfFields $rootEntry + */ + public function setRootEntry(InterfaceBunchOfFields $rootEntry): void; }