Skip to content

Commit 4acf764

Browse files
committed
Move dependency ComponentViewModelInterface from Loki_Base to Loki_Components
1 parent 3cb38da commit 4acf764

1 file changed

Lines changed: 6 additions & 8 deletions

File tree

ViewModel/Block/AbstractRenderer.php

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
use Magento\Framework\View\Element\AbstractBlock;
77
use Magento\Framework\View\Element\Block\ArgumentInterface;
88
use Magento\Framework\View\LayoutInterface;
9-
use Loki\Components\Component\ComponentViewModelInterface;
10-
use RuntimeException;
119

1210
abstract 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

0 commit comments

Comments
 (0)