diff --git a/Content/StructureResolver.php b/Content/StructureResolver.php
index fd15f0d..19354a7 100644
--- a/Content/StructureResolver.php
+++ b/Content/StructureResolver.php
@@ -13,6 +13,7 @@
namespace Sulu\Bundle\HeadlessBundle\Content;
+use Sulu\Bundle\HeadlessBundle\Content\StructureResolver\StructureResolverExtensionInterface;
use Sulu\Bundle\DocumentManagerBundle\Bridge\DocumentInspector;
use Sulu\Bundle\PageBundle\Document\BasePageDocument;
use Sulu\Bundle\PageBundle\Preview\PageRouteDefaultsProvider;
@@ -50,16 +51,23 @@ class StructureResolver implements StructureResolverInterface
*/
private $referenceStorePool;
+ /**
+ * @var StructureResolverExtensionInterface[]
+ */
+ private iterable $structureResolverExtensions;
+
public function __construct(
ContentResolverInterface $contentResolver,
StructureManagerInterface $structureManager,
DocumentInspector $documentInspector,
- ReferenceStorePoolInterface $referenceStorePool
+ ReferenceStorePoolInterface $referenceStorePool,
+ iterable $structureResolverExtensions
) {
$this->contentResolver = $contentResolver;
$this->structureManager = $structureManager;
$this->documentInspector = $documentInspector;
$this->referenceStorePool = $referenceStorePool;
+ $this->structureResolverExtensions = $structureResolverExtensions;
}
/**
@@ -95,6 +103,10 @@ public function resolve(
$data['view'][$property->getName()] = $contentView->getView();
}
+ foreach ($this->structureResolverExtensions as $structureResolverExtension) {
+ $data[$structureResolverExtension->getKey()] = $structureResolverExtension->resolve($requestedStructure, $locale);
+ }
+
return $data;
}
diff --git a/Content/StructureResolver/StructureResolverExtensionInterface.php b/Content/StructureResolver/StructureResolverExtensionInterface.php
new file mode 100644
index 0000000..520852c
--- /dev/null
+++ b/Content/StructureResolver/StructureResolverExtensionInterface.php
@@ -0,0 +1,19 @@
+
+
+