public function ajax()
 {
     $this->disableLayout();
     $query = $this->_getRequest()->query;
     $sort = $query->get('s', 'level');
     $page = $query->get('p', 1);
     switch ($sort) {
         case SortFieldEnum::GAMES:
         case SortFieldEnum::BADGES:
         case SortFieldEnum::FRIENDS:
         case SortFieldEnum::TIME:
         case SortFieldEnum::LEVEL:
             $col = $sort;
             break;
         default:
             return new Error404Response();
     }
     $cache = new UserListCache($col, $page);
     $users = $cache->retrieve();
     return new UserAjaxView($users, $col, $page);
 }
示例#2
0
 public function friends()
 {
     $cache = new UserListCache(SortFieldEnum::FRIENDS);
     return $cache->retrieve();
 }