Вікі-код для Додавання процедур
Показати останніх авторів
| author | version | line-number | content |
|---|---|---|---|
| 1 | текст | ||
| 2 | |||
| 3 | {{code language="php" layout="LINENUMBERS" title="ExampleApi"}} | ||
| 4 | <?php | ||
| 5 | namespace App\Api\Procedures; | ||
| 6 | |||
| 7 | use Ufo\JsonRpcBundle\ApiMethod\Interfaces\IRpcService; | ||
| 8 | |||
| 9 | class ExampleApi implements IRpcService | ||
| 10 | { | ||
| 11 | public function __construct( | ||
| 12 | // connecting some dependencies to retrieve data | ||
| 13 | ) {} | ||
| 14 | |||
| 15 | public function getUserNameByUuid(string $userId): string | ||
| 16 | { | ||
| 17 | // some logic get user info by id | ||
| 18 | return 'some result'; | ||
| 19 | } | ||
| 20 | |||
| 21 | public function sendEmail(string $email, string $subject, string $text): bool | ||
| 22 | { | ||
| 23 | // some logic send email | ||
| 24 | return true; | ||
| 25 | } | ||
| 26 | } | ||
| 27 | {{/code}} |