private function getBlocksByField($fieldTypeIdentifier, $type, $localTemplate = null)
{
$fieldBlockName = $this->getRenderFieldBlockName($fieldTypeIdentifier, $type);
if ($localTemplate !== null) {
// $localTemplate might be a Twig_Template instance already (e.g. using _self Twig keyword)
if (!$localTemplate instanceof Twig_Template) {
$localTemplate = $this->twig->loadTemplate($localTemplate);
}
$block = $this->searchBlock($fieldBlockName, $localTemplate);
if ($block !== null) {
return [$fieldBlockName => $block];
}
}
return $this->getBlockByName($fieldBlockName, $type === self::EDIT ? 'fieldEditResources' : 'fieldViewResources');
}