function FieldConfigListBuilder::buildRow
Same name in other branches
- 9 core/modules/field_ui/src/FieldConfigListBuilder.php \Drupal\field_ui\FieldConfigListBuilder::buildRow()
- 10 core/modules/field_ui/src/FieldConfigListBuilder.php \Drupal\field_ui\FieldConfigListBuilder::buildRow()
- 11.x core/modules/field_ui/src/FieldConfigListBuilder.php \Drupal\field_ui\FieldConfigListBuilder::buildRow()
Overrides EntityListBuilder::buildRow
File
-
core/
modules/ field_ui/ src/ FieldConfigListBuilder.php, line 147
Class
- FieldConfigListBuilder
- Provides lists of field config entities.
Namespace
Drupal\field_uiCode
public function buildRow(EntityInterface $field_config) {
/** @var \Drupal\field\FieldConfigInterface $field_config */
$field_storage = $field_config->getFieldStorageDefinition();
$route_parameters = [
'field_config' => $field_config->id(),
] + FieldUI::getRouteBundleParameter($this->entityTypeManager
->getDefinition($this->targetEntityTypeId), $this->targetBundle);
$row = [
'id' => Html::getClass($field_config->getName()),
'data' => [
'label' => $field_config->getLabel(),
'field_name' => $field_config->getName(),
'field_type' => [
'data' => [
'#type' => 'link',
'#title' => $this->fieldTypeManager
->getDefinitions()[$field_storage->getType()]['label'],
'#url' => Url::fromRoute("entity.field_config.{$this->targetEntityTypeId}_storage_edit_form", $route_parameters),
'#options' => [
'attributes' => [
'title' => $this->t('Edit field settings.'),
],
],
],
],
],
];
// Add the operations.
$row['data'] = $row['data'] + parent::buildRow($field_config);
if ($field_storage->isLocked()) {
$row['data']['operations'] = [
'data' => [
'#markup' => $this->t('Locked'),
],
];
$row['class'][] = 'menu-disabled';
}
return $row;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.