File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 66use Magento \Framework \View \Element \AbstractBlock ;
77use Magento \Framework \View \Element \Block \ArgumentInterface ;
88use Magento \Framework \View \LayoutInterface ;
9- use Loki \Components \Component \ComponentViewModelInterface ;
10- use RuntimeException ;
119
1210abstract class AbstractRenderer implements ArgumentInterface
1311{
@@ -20,18 +18,18 @@ public function __construct(
2018 ) {
2119 }
2220
23- protected function populateBlock (
21+ public function populateBlock (
2422 AbstractBlock $ block ,
2523 array $ data = []
2624 ): void {
2725 $ block ->addData ($ data );
28- $ block ->setAncestorBlock ($ this ->ancestorBlock );
26+ $ block ->setAncestorBlock ($ this ->getAncestorBlock () );
2927 $ block ->setUniqId ($ this ->getUniqId ($ block , $ data ));
28+ }
3029
31- $ viewModel = $ this ->ancestorBlock ->getViewModel ();
32- if ($ viewModel instanceof ComponentViewModelInterface) {
33- $ block ->setViewModel ($ viewModel );
34- }
30+ public function getAncestorBlock (): ?AbstractBlock
31+ {
32+ return $ this ->ancestorBlock ;
3533 }
3634
3735 protected function getCounter (AbstractBlock $ block ): int
You can’t perform that action at this time.
0 commit comments