You are here

public function ConfigSplitEntityListBuilder::buildRow in Configuration Split 8

Same name and namespace in other branches
  1. 2.0.x src/ConfigSplitEntityListBuilder.php \Drupal\config_split\ConfigSplitEntityListBuilder::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/ConfigSplitEntityListBuilder.php, line 64

Class

ConfigSplitEntityListBuilder
Provides a listing of Configuration Split setting entities.

Namespace

Drupal\config_split

Code

public function buildRow(EntityInterface $entity) {
  $row['label'] = $entity
    ->toLink();
  $row['id'] = $entity
    ->id();
  $config = $this->configFactory
    ->get('config_split.config_split.' . $entity
    ->id());
  $row['description'] = $config
    ->get('description');
  $row['status'] = $config
    ->get('status') ? 'active' : 'inactive';
  if ($config
    ->get('status') != $entity
    ->status()) {
    $row['status'] .= ' (overwritten)';
  }
  return $row + parent::buildRow($entity);
}