You are here

public function Users::getCache in Rocket.Chat 8.2

Parameters

bool $forceReload:

Return value

array

Overrides CollectionInterface::getCache

File

modules/rocket_chat_api/src/RocketChat/Collection/Users.php, line 48

Class

Users

Namespace

Drupal\rocket_chat_api\RocketChat\Collection

Code

public function getCache($forceReload = FALSE) {
  $this
    ->refreshCache(FALSE);
  $idList = $this->state
    ->get(self::LIST, []);
  foreach ($idList as $index => $id) {
    $idList[$index] = self::USER . $id;
  }
  $users = $this->state
    ->getMultiple($idList);
  if (empty($users)) {
    $users = [];
  }
  return $users;
}