You are here

public function CustomLanguageListBuilder::buildRow in Custom Language field 8

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 DraggableListBuilder::buildRow

See also

\Drupal\Core\Entity\EntityListBuilder::render()

File

src/CustomLanguageListBuilder.php, line 37

Class

CustomLanguageListBuilder
Defines a class to build a listing of Custom Languages.

Namespace

Drupal\languagefield

Code

public function buildRow(EntityInterface $entity) {

  /** @var \Drupal\languagefield\Entity\CustomLanguageInterface $entity */
  $row['label'] = $entity
    ->label();
  $row['langcode'] = [
    '#markup' => $entity
      ->id(),
  ];
  $row['native_name'] = [
    '#markup' => $entity
      ->getNativeName(),
  ];
  return $row + parent::buildRow($entity);
}