You are here

public function KeyConfigOverrideListBuilder::buildRow in Key 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 EntityListBuilder::buildRow

See also

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

File

src/Controller/KeyConfigOverrideListBuilder.php, line 83

Class

KeyConfigOverrideListBuilder
Provides a listing of key configuration overrides.

Namespace

Drupal\key\Controller

Code

public function buildRow(EntityInterface $entity) {

  /* @var $entity \Drupal\key\KeyConfigOverrideInterface */

  // Build the complete configuration ID.
  $config_id = '';
  $config_type = $entity
    ->getConfigType();
  if ($config_type != 'system.simple') {
    $definition = $this->entityTypeManager
      ->getDefinition($config_type);
    $config_id .= $definition
      ->getConfigPrefix() . '.';
  }
  $config_id .= $entity
    ->getConfigName();
  $config_id .= ':' . $entity
    ->getConfigItem();
  $key = $this->keyRepository
    ->getKey($entity
    ->getKeyId());
  $row['label'] = $entity
    ->label();
  $row['config_id'] = $config_id;
  $row['key_id'] = $key
    ->label();
  return $row + parent::buildRow($entity);
}