Вікі-код для Додавання процедур
Показати останніх авторів
| author | version | line-number | content |
|---|---|---|---|
| 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}} |