public function ExtraFieldFormManager::fieldInfo in Extra Field 8.2
Exposes the ExtraField plugins to hook_entity_extra_field_info().
Return value
array The array structure is identical to that of the return value of \Drupal\Core\Entity\EntityFieldManagerInterface::getExtraFields().
Overrides ExtraFieldManagerBase::fieldInfo
See also
hook_entity_extra_field_info()
File
- src/
Plugin/ ExtraFieldFormManager.php, line 76
Class
- ExtraFieldFormManager
- Manages Extra Field form plugins.
Namespace
Drupal\extra_field\PluginCode
public function fieldInfo() {
$info = [];
$definitions = $this
->getDefinitions();
foreach ($definitions as $pluginId => $definition) {
$entityBundles = $this
->supportedEntityBundles($definition['bundles']);
foreach ($entityBundles as $entityBundle) {
$entityType = $entityBundle['entity'];
$bundle = $entityBundle['bundle'];
$fieldName = $this
->fieldName($pluginId);
$info[$entityType][$bundle]['form'][$fieldName] = [
'label' => $definition['label'],
'description' => isset($definition['description']) ? $definition['description'] : '',
'weight' => $definition['weight'],
'visible' => $definition['visible'],
];
}
}
return $info;
}