You are here

public function FieldInheritanceListBuilder::buildRow in Field Inheritance 8

Same name and namespace in other branches
  1. 2.0.x src/FieldInheritanceListBuilder.php \Drupal\field_inheritance\FieldInheritanceListBuilder::buildRow()

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

src/FieldInheritanceListBuilder.php, line 30

Class

FieldInheritanceListBuilder
Provides a listing of Field inheritance entities.

Namespace

Drupal\field_inheritance

Code

public function buildRow(EntityInterface $entity) {
  $row['label'] = $entity
    ->label();
  $row['id'] = $entity
    ->id();
  $row['type'] = $entity
    ->type();
  $row['source_entity'] = $entity
    ->sourceEntityType() . ':' . $entity
    ->sourceEntityBundle();
  $row['source_field'] = $entity
    ->sourceField();
  $row['destination_entity'] = $entity
    ->destinationEntityType() . ':' . $entity
    ->destinationEntityBundle();
  $row['destination_field'] = $entity
    ->destinationField() ?: $this
    ->t('N/A');
  return $row + parent::buildRow($entity);
}