You are here

public function GoogleApiClientListBuilder::buildRow in Google API PHP Client 8.3

Same name and namespace in other branches
  1. 8.4 src/Entity/Controller/GoogleApiClientListBuilder.php \Drupal\google_api_client\Entity\Controller\GoogleApiClientListBuilder::buildRow()
  2. 8.2 src/Entity/Controller/GoogleApiClientListBuilder.php \Drupal\google_api_client\Entity\Controller\GoogleApiClientListBuilder::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/Entity/Controller/GoogleApiClientListBuilder.php, line 49

Class

GoogleApiClientListBuilder
Provides a list controller for google_api_client entity.

Namespace

Drupal\google_api_client\Entity\Controller

Code

public function buildRow(EntityInterface $entity) {
  $row = [
    'id' => $entity
      ->getId(),
    'Name' => $entity
      ->getName(),
    'Services' => implode(", ", _google_api_client_google_services_names($entity
      ->getServices())),
    'is_authenticated' => $entity
      ->getAuthenticated() ? $this
      ->t('Yes') : $this
      ->t('No'),
    'Created By' => $entity
      ->getOwner()
      ->toLink($entity
      ->getOwner()
      ->getAccountName()),
  ];
  return $row + parent::buildRow($entity);
}