public function AnalyticsServiceListBuilder::buildRow in Analytics 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/
AnalyticsServiceListBuilder.php, line 45
Class
- AnalyticsServiceListBuilder
- Provides a listing of analytics instances.
Namespace
Drupal\analyticsCode
public function buildRow(EntityInterface $entity) {
/** @var \Drupal\analytics\Entity\AnalyticsServiceInterface $entity */
$row['label'] = $entity
->label();
$row['service'] = $entity
->getService()
->getLabel();
// @todo Do we need to actually show if overwritten? Do any other list builders do this?
/** @var \Drupal\analytics\Entity\AnalyticsServiceInterface $overridden_entity */
$overridden_entity = $this->storage
->load($entity
->id());
$row['status'] = $overridden_entity
->status() ? $this
->t('Enabled') : $this
->t('Disabled');
if ($overridden_entity
->status() != $entity
->status()) {
$row['status'] .= ' (overwritten)';
}
return $row + parent::buildRow($entity);
}