cache = $cache; $this->userModel = $userModel; } /** * Get a specific user by the username * * @access public * @param string $username Username * @return array */ public function getByUsername($username) { $key = $this->cachePrefix.$username; $user = $this->cache->get($key); if ($user === null) { $user = $this->userModel->getByUsername($username); $this->cache->set($key, $user); } return $user; } }