public FieldConfigListBuilder::buildRow(EntityInterface $field_config)
Builds a row for an entity in the entity listing.
Parameters
\Drupal\Core\Entity\EntityInterface $entity: The entity for this row of the list.
Return value
array A render array structure of fields for this entity.
Overrides EntityListBuilder::buildRow
See also
\Drupal\Core\Entity\EntityListBuilder::render()
File
- core/modules/field_ui/src/FieldConfigListBuilder.php, line 118
Class
- FieldConfigListBuilder
- Provides lists of field config entities.
Namespace
Drupal\field_ui
Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | public function buildRow(EntityInterface $field_config ) { /** @var \Drupal\field\FieldConfigInterface $field_config */ $field_storage = $field_config ->getFieldStorageDefinition(); $route_parameters = array ( 'field_config' => $field_config ->id(), ) + FieldUI::getRouteBundleParameter( $this ->entityManager->getDefinition( $this ->targetEntityTypeId), $this ->targetBundle); $row = array ( 'id' => Html::getClass( $field_config ->getName()), 'data' => array ( 'label' => $field_config ->getLabel(), 'field_name' => $field_config ->getName(), 'field_type' => array ( 'data' => array ( '#type' => 'link' , '#title' => $this ->fieldTypeManager->getDefinitions()[ $field_storage -> getType ()][ 'label' ], '#url' => Url::fromRoute( "entity.field_config.{$this->targetEntityTypeId}_storage_edit_form" , $route_parameters ), '#options' => array ( 'attributes' => array ( 'title' => $this ->t( 'Edit field settings.' ))), ), ), ), ); // Add the operations. $row [ 'data' ] = $row [ 'data' ] + parent::buildRow( $field_config ); if ( $field_storage ->isLocked()) { $row [ 'data' ][ 'operations' ] = array ( 'data' => array ( '#markup' => $this ->t( 'Locked' ))); $row [ 'class' ][] = 'menu-disabled' ; } return $row ; } |
Please login to continue.