mirror of
https://github.com/openvk/openvk
synced 2024-11-11 01:19:53 +03:00
VKAPI: add counters
field in Users.get
This commit is contained in:
parent
93bfe6e886
commit
35bd3ad1e0
1 changed files with 11 additions and 1 deletions
|
@ -2,6 +2,7 @@
|
|||
namespace openvk\VKAPI\Handlers;
|
||||
use openvk\Web\Models\Entities\{User, Report};
|
||||
use openvk\Web\Models\Repositories\Users as UsersRepo;
|
||||
use openvk\Web\Models\Repositories\{Photos, Clubs, Albums, Videos, Notes, Audios};
|
||||
use openvk\Web\Models\Repositories\Reports;
|
||||
|
||||
final class Users extends VKAPIRequestHandler
|
||||
|
@ -180,7 +181,16 @@ final class Users extends VKAPIRequestHandler
|
|||
break;
|
||||
case "rating":
|
||||
$response[$i]->rating = $usr->getRating();
|
||||
break;
|
||||
break;
|
||||
case "counters":
|
||||
$response[$i]->counters = (object) [
|
||||
"friends_count" => $usr->getFriendsCount(),
|
||||
"photos_count" => (new Albums)->getUserPhotosCount($usr),
|
||||
"videos_count" => (new Videos)->getUserVideosCount($usr),
|
||||
"audios_count" => (new Audios)->getUserCollectionSize($usr),
|
||||
"notes_count" => (new Notes)->getUserNotesCount($usr),
|
||||
];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue