D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
proc
/
self
/
root
/
opt
/
psa
/
admin
/
plib
/
modules
/
rest-api
/
v2
/
externals
/
Handler
/
Filename :
ClientsIdStatistics.php
back
Copy
<?php // Copyright 1999-2024. WebPros International GmbH. All rights reserved. namespace PleskExt\RestApi\v2\Handler; use PleskExt\RestApi\v2\Annotation\Producer; use PleskExt\RestApi\v2\Helper\InvokableHandler; use PleskExt\RestApi\v2\Mapper\ClientStatistics as ClientStatisticsMapper; use PleskExt\RestApi\v2\SDK; use PleskRestApi\Slim\Psr7\Request; use PleskRestApi\Slim\Psr7\Response; class ClientsIdStatistics extends InvokableHandler { /** * @Producer(mapper=ClientStatisticsMapper::class) */ protected function get(Request $request, Response $response) { $client = SDK\pm_Client::getByClientId($request->getAttribute('id')); $statistics = $client->getStatistics(); $response->getBody()->write($this->produce($statistics)); return $response; } }