]> _ Git - cubist_cms-back.git/commitdiff
wip #4285
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 19 May 2022 17:59:57 +0000 (19:59 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 19 May 2022 17:59:57 +0000 (19:59 +0200)
src/app/Magic/Fields/BunchOfFieldsMultiple.php
src/app/Magic/InterfaceBunchOfFields.php

index 309e4e81ee1affc6b5266cfbcaf31cf379e88df6..3593b56376fb5ce933ea43f375e859362bcce3ea 100644 (file)
@@ -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();
                 }
index 851f5b00902234ba274aba750aa321a7a8ef09f0..425a6d02580269af884d60afce12e2c3e8b96d99 100644 (file)
@@ -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;
 }