You are here

public function UserDefaultPageConfigEntityListBuilder::buildRow in User Default Page 8

Same name and namespace in other branches
  1. 8.2 src/UserDefaultPageConfigEntityListBuilder.php \Drupal\user_default_page\UserDefaultPageConfigEntityListBuilder::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/UserDefaultPageConfigEntityListBuilder.php, line 33

Class

UserDefaultPageConfigEntityListBuilder
Provides a listing of User default page entities.

Namespace

Drupal\user_default_page

Code

public function buildRow(EntityInterface $entity) {
  $user_values = $entity
    ->getUsers();
  $uids = explode(',', $user_values);
  $default_users = User::loadMultiple($uids);
  $default_value = EntityAutocomplete::getEntityLabels($default_users);
  $row['label'] = $entity
    ->label();
  $row['roles'] = implode(',', $entity
    ->getUserRoles());
  $row['weight'] = $entity
    ->getWeight();
  $row['users'] = $default_value;
  $row['login_path'] = $entity
    ->getLoginRedirect();
  $row['logout_path'] = $entity
    ->getLogoutRedirect();
  $row['login_message'] = $entity
    ->getLoginRedirectMessage();
  $row['logout_message'] = $entity
    ->getLogoutRedirectMessage();
  return $row + parent::buildRow($entity);
}