1 | <?php |
||
8 | class Conversations extends Provider |
||
9 | { |
||
10 | protected $loginRequiredFor = ['last', 'sendMessage', 'sendEmail']; |
||
11 | |||
12 | /** |
||
13 | * Send message to a user. |
||
14 | * |
||
15 | * @param array|int $userId |
||
16 | * @param string $text |
||
17 | * @param int|null $pinId |
||
18 | * |
||
19 | * @throws InvalidRequestException |
||
20 | * |
||
21 | * @return bool |
||
22 | */ |
||
23 | public function sendMessage($userId, $text, $pinId = null) |
||
29 | |||
30 | /** |
||
31 | * Send email. |
||
32 | * |
||
33 | * @param array|int $emails |
||
34 | * @param string $text |
||
35 | * @param int|null $pinId |
||
36 | * |
||
37 | * @throws InvalidRequestException |
||
38 | * |
||
39 | * @return bool |
||
40 | */ |
||
41 | public function sendEmail($emails, $text, $pinId = null) |
||
47 | |||
48 | /** |
||
49 | * Get last user conversations. |
||
50 | * |
||
51 | * @return array|bool |
||
52 | */ |
||
53 | public function last() |
||
57 | |||
58 | /** |
||
59 | * @param array|int $userId |
||
60 | * @param string $text |
||
61 | * @param int $pinId |
||
62 | * @param array $emails |
||
63 | * |
||
64 | * @throws InvalidRequestException |
||
65 | * |
||
66 | * @return bool |
||
67 | */ |
||
68 | protected function callSendMessage($userId, $text, $pinId, array $emails = []) |
||
81 | |||
82 | /** |
||
83 | * @param $userId |
||
84 | * @param array $emails |
||
85 | * @throws InvalidRequestException |
||
86 | */ |
||
87 | protected function guardAgainstEmptyData($userId, array $emails) |
||
93 | } |
||
94 |