/** * Get a user's account info. * * @param ProjectAccess $user * @param bool $reset * * @return array * An array containing 'email' and 'display_name'. */ protected function getAccount(ProjectAccess $user, $reset = false) { $cacheKey = 'account:' . $user->id; $cache = CacheUtil::getCache(); if ($reset || !($details = $cache->fetch($cacheKey))) { $this->debug('Loading account details for user ' . $user->id); $details = $user->getAccount()->getProperties(); $cache->save($cacheKey, $details, $this->usersTtl); } return $details; }
/** * Get a user's account info. * * @param ProjectAccess $user * @param bool $reset * * @return array * An array containing 'email' and 'display_name'. */ public function getAccount(ProjectAccess $user, $reset = false) { $cacheKey = 'account:' . $user->id; if ($reset || !($details = self::$cache->fetch($cacheKey))) { $details = $user->getAccount()->getProperties(); self::$cache->save($cacheKey, $details, $this->config->get('api.users_ttl')); } return $details; }