public function renderInitcmsAdminBlock(LayoutBlockInterface $layoutBlock)
{
/** @var \Sonata\AdminBundle\Admin\AdminInterface $layoutBlockAdmin */
$layoutBlockAdmin = $this->getService('networking_init_cms.admin.layout_block');
if ($layoutBlock->getObjectId()) {
// Draft View
$contentItem = $layoutBlock->getContent();
} else {
$classType = $layoutBlock->getClassType();
$contentItem = new $classType();
}
if (!is_object($contentItem)) {
$layoutBlockAdmin->delete($layoutBlock);
return false;
}
$adminContent = $contentItem->getAdminContent();
return $this->getService('templating')->render($adminContent['template'], $adminContent['content']);
}