You are here

public function Channels::getCache in Rocket.Chat 8.2

Parameters

bool $forceReload:

Return value

array

Overrides CollectionInterface::getCache

File

modules/rocket_chat_api/src/RocketChat/Collection/Channels.php, line 46

Class

Channels

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::CHANNEL . $id;
  }
  $channels = $this->state
    ->getMultiple($idList);
  if (empty($channels)) {
    $channels = [];
  }
  return $channels;
}