You are here

public function GauthListBuilder::buildRow in Google Auth 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/Entity/Controller/GauthListBuilder.php, line 49

Class

GauthListBuilder
Provides a list controller for gauth entity.

Namespace

Drupal\gauth\Entity\Controller

Code

public function buildRow(EntityInterface $entity) {

  /* @var $entity \Drupal\gauth\Entity\Gauth */
  $row = [
    'id' => $entity
      ->getId(),
    'Name' => $entity
      ->getName(),
    'Services' => implode(", ", gauth_google_services_names([], [], [], $entity
      ->getServices())),
    'is_authenticated' => $entity
      ->getAuthenticated() ? t('Yes') : t('No'),
  ];
  return $row + parent::buildRow($entity);
}