Версія 2.1 додана 2024/05/09 19:37 автором Ashterix

Показати останніх авторів
1 текст
2
3 {{code language="php" layout="LINENUMBERS" title="
4
5 ExampleApi"}}
6 <?php
7 namespace App\Api\Procedures;
8
9 use App\Api\DTO\FormDTO;
10 use App\CQRS\Query\FormQuery;
11 use App\VO\FormObject;
12 use Symfony\Component\Validator\Constraints as Assert;
13 use Ufo\JsonRpcBundle\ApiMethod\Interfaces\IRpcService;
14 use Ufo\RpcObject\RPC;
15
16 class ExampleApi implements IRpcService
17 {
18 public function __construct(
19 // connecting some dependencies to retrieve data
20 ) {}
21
22 public function getUserNameByUuid(string $userId): string
23 {
24 // some logic get user info by id
25 return 'some result';
26 }
27
28 public function sendEmail(string $email, string $subject, string $text): bool
29 {
30 // some logic send email
31 return true;
32 }
33 }
34 {{/code}}