mirror of
https://github.com/openvk/openvk
synced 2024-11-14 02:59:12 +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;
|
namespace openvk\VKAPI\Handlers;
|
||||||
use openvk\Web\Models\Entities\{User, Report};
|
use openvk\Web\Models\Entities\{User, Report};
|
||||||
use openvk\Web\Models\Repositories\Users as UsersRepo;
|
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;
|
use openvk\Web\Models\Repositories\Reports;
|
||||||
|
|
||||||
final class Users extends VKAPIRequestHandler
|
final class Users extends VKAPIRequestHandler
|
||||||
|
@ -181,6 +182,15 @@ final class Users extends VKAPIRequestHandler
|
||||||
case "rating":
|
case "rating":
|
||||||
$response[$i]->rating = $usr->getRating();
|
$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