You are here

public function RoleExpireRid::preRender in Role Expire 8

Same name and namespace in other branches
  1. 2.x src/Plugin/views/field/RoleExpireRid.php \Drupal\role_expire\Plugin\views\field\RoleExpireRid::preRender()

inheritdoc}

Overrides FieldPluginBase::preRender

File

src/Plugin/views/field/RoleExpireRid.php, line 79

Class

RoleExpireRid
Field handler to display the role expire data.

Namespace

Drupal\role_expire\Plugin\views\field

Code

public function preRender(&$values) {
  $this->items = [];
  if (is_array($values)) {
    foreach ($values as $user) {
      $expirations = $this->roleExpireApi
        ->getAllUserRecords($user->uid);
      foreach ($expirations as $role => $timestamp) {
        $this->items[$user->uid][$role]['role'] = $role;
      }
    }
  }
}