public function ConnectionListBuilder::buildRow in RedHen CRM 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
- modules/
redhen_connection/ src/ ConnectionListBuilder.php, line 27
Class
- ConnectionListBuilder
- Defines a class to build a listing of Connection entities.
Namespace
Drupal\redhen_connectionCode
public function buildRow(EntityInterface $entity) {
$bundles = \Drupal::service('entity_type.bundle.info')
->getBundleInfo($entity
->getEntityType()
->id());
/* @var $entity \Drupal\redhen_connection\Entity\Connection */
$row['type'] = $bundles[$entity
->getType()]['label'];
$row['name'] = $entity
->toLink()
->toString();
$row['status'] = $entity
->isActive() ? $this
->t('Active') : $this
->t('Inactive');
return $row + parent::buildRow($entity);
}