bundles/BlockManagerDebugBundle/DataCollector/BlockManagerDataCollector.php
public function collectBlockView(BlockViewInterface $blockView): void
    {
        $block = $blockView->getBlock();
        $blockDefinition = $block->getDefinition();

        $blockData = [
            'id' => $block->getId(),
            'layout_id' => $block->getLayoutId(),
            'definition' => $blockDefinition->getName(),
            'view_type' => $blockDefinition->hasViewType($block->getViewType()) ?
                $blockDefinition->getViewType($block->getViewType())->getName() :
                'Invalid view type',
            'locale' => $block->getLocale(),
            'template' => null,
            'template_path' => null,
        ];

        if ($blockView->getTemplate() !== null) {
            $templateSource = $this->getTemplateSource($blockView->getTemplate());

            $blockData['template'] = $templateSource->getName();
            $blockData['template_path'] = $templateSource->getPath();
        }

        $this->data['blocks'][] = $blockData;
    }
public function collectBlockView(BlockViewInterface $blockView): void
    {
        $block = $blockView->getBlock();
        $blockDefinition = $block->getDefinition();

        $blockData = [
            'id' => $block->getId(),
            'layout_id' => $block->getLayoutId(),
            'definition' => $blockDefinition->getName(),
            'view_type' => $blockDefinition->hasViewType($block->getViewType()) ?
                $blockDefinition->getViewType($block->getViewType())->getName() :
                'Invalid view type',
            'locale' => $block->getLocale(),
            'template' => null,
            'template_path' => null,
        ];

        if ($blockView->getTemplate() !== null) {
            $templateSource = $this->getTemplateSource($blockView->getTemplate());

            $blockData['template'] = $templateSource->getName();
            $blockData['template_path'] = $templateSource->getPath();
        }

        $this->data['blocks'][] = $blockData;
    }
public function collectBlockView ( BlockViewInterface $ blockView ) : void { $ block = $ blockView -> getBlock ( ) ; $ blockDefinition = $ block -> getDefinition ( ) ; $ blockData = [ 'id' => $ block -> getId ( ) , 'layout_id' => $ block -> getLayoutId ( ) , 'definition' => $ blockDefinition -> getName ( ) , 'view_type' => $ blockDefinition -> hasViewType ( $ block -> getViewType ( ) ) ? $ blockDefinition -> getViewType ( $ block -> getViewType ( ) ) -> getName ( ) : 'Invalid view type' , 'locale' => $ block -> getLocale ( ) , 'template' => null , 'template_path' => null , ] ; if ( $ blockView -> getTemplate ( ) !== null ) { $ templateSource = $ this -> getTemplateSource ( $ blockView -> getTemplate ( ) ) ; $ blockData [ 'template' ] = $ templateSource -> getName ( ) ; $ blockData [ 'template_path' ] = $ templateSource -> getPath ( ) ; } $ this -> data [ 'blocks' ] [ ] = $ blockData ; }
Collects the block view data.
Collects the block view data .