diff --git a/lib/RoadizCoreBundle/src/Api/TreeWalker/NodeSourceWalkerContext.php b/lib/RoadizCoreBundle/src/Api/TreeWalker/NodeSourceWalkerContext.php index 31dfd730..42a20eb9 100644 --- a/lib/RoadizCoreBundle/src/Api/TreeWalker/NodeSourceWalkerContext.php +++ b/lib/RoadizCoreBundle/src/Api/TreeWalker/NodeSourceWalkerContext.php @@ -10,6 +10,7 @@ use RZ\Roadiz\CoreBundle\Bag\NodeTypes; use RZ\Roadiz\CoreBundle\EntityApi\NodeSourceApi; use RZ\Roadiz\CoreBundle\NodeType\NodeTypeResolver; +use RZ\Roadiz\CoreBundle\Preview\PreviewResolverInterface; use RZ\TreeWalker\WalkerContextInterface; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\RequestStack; @@ -24,6 +25,7 @@ class NodeSourceWalkerContext implements WalkerContextInterface private ManagerRegistry $managerRegistry; private CacheItemPoolInterface $cacheAdapter; private NodeTypeResolver $nodeTypeResolver; + private PreviewResolverInterface $previewResolver; public function __construct( Stopwatch $stopwatch, @@ -33,6 +35,7 @@ public function __construct( ManagerRegistry $managerRegistry, CacheItemPoolInterface $cacheAdapter, NodeTypeResolver $nodeTypeResolver, + PreviewResolverInterface $previewResolver ) { $this->stopwatch = $stopwatch; $this->nodeTypesBag = $nodeTypesBag; @@ -41,6 +44,7 @@ public function __construct( $this->managerRegistry = $managerRegistry; $this->cacheAdapter = $cacheAdapter; $this->nodeTypeResolver = $nodeTypeResolver; + $this->previewResolver = $previewResolver; } /** @@ -123,4 +127,12 @@ public function getNodeTypeResolver(): NodeTypeResolver { return $this->nodeTypeResolver; } + + /** + * @return PreviewResolverInterface + */ + public function getPreviewResolver(): PreviewResolverInterface + { + return $this->previewResolver; + } } diff --git a/lib/RoadizCoreBundle/src/Api/TreeWalker/NodeSourceWalkerContextFactory.php b/lib/RoadizCoreBundle/src/Api/TreeWalker/NodeSourceWalkerContextFactory.php index e78e8ed9..9dea52fb 100644 --- a/lib/RoadizCoreBundle/src/Api/TreeWalker/NodeSourceWalkerContextFactory.php +++ b/lib/RoadizCoreBundle/src/Api/TreeWalker/NodeSourceWalkerContextFactory.php @@ -9,6 +9,7 @@ use RZ\Roadiz\CoreBundle\Bag\NodeTypes; use RZ\Roadiz\CoreBundle\EntityApi\NodeSourceApi; use RZ\Roadiz\CoreBundle\NodeType\NodeTypeResolver; +use RZ\Roadiz\CoreBundle\Preview\PreviewResolverInterface; use RZ\TreeWalker\WalkerContextInterface; use Symfony\Component\HttpFoundation\RequestStack; use Symfony\Component\Stopwatch\Stopwatch; @@ -22,6 +23,7 @@ final class NodeSourceWalkerContextFactory implements WalkerContextFactoryInterf private ManagerRegistry $managerRegistry; private CacheItemPoolInterface $cacheAdapter; private NodeTypeResolver $nodeTypeResolver; + private PreviewResolverInterface $previewResolver; public function __construct( Stopwatch $stopwatch, @@ -30,7 +32,8 @@ public function __construct( RequestStack $requestStack, ManagerRegistry $managerRegistry, CacheItemPoolInterface $cacheAdapter, - NodeTypeResolver $nodeTypeResolver + NodeTypeResolver $nodeTypeResolver, + PreviewResolverInterface $previewResolver ) { $this->stopwatch = $stopwatch; $this->nodeTypesBag = $nodeTypesBag; @@ -39,6 +42,7 @@ public function __construct( $this->managerRegistry = $managerRegistry; $this->cacheAdapter = $cacheAdapter; $this->nodeTypeResolver = $nodeTypeResolver; + $this->previewResolver = $previewResolver; } public function createWalkerContext(): WalkerContextInterface @@ -50,7 +54,8 @@ public function createWalkerContext(): WalkerContextInterface $this->requestStack, $this->managerRegistry, $this->cacheAdapter, - $this->nodeTypeResolver + $this->nodeTypeResolver, + $this->previewResolver ); } }