1 | <?php |
||
8 | class TwitterDirectMessage |
||
9 | { |
||
10 | /** @var string */ |
||
11 | private $content; |
||
12 | |||
13 | /** @var string */ |
||
14 | private $to; |
||
15 | |||
16 | /** @var bool */ |
||
17 | public $isJsonRequest = true; |
||
18 | |||
19 | /** @var string */ |
||
20 | private $apiEndpoint = 'direct_messages/events/new'; |
||
21 | |||
22 | /** |
||
23 | * TwitterDirectMessage constructor. |
||
24 | * |
||
25 | * @param $to |
||
26 | * @param $content |
||
27 | */ |
||
28 | 6 | public function __construct($to, $content) |
|
33 | |||
34 | /** |
||
35 | * Get Twitter direct message content. |
||
36 | * |
||
37 | * @return string |
||
38 | */ |
||
39 | 3 | public function getContent() |
|
43 | |||
44 | /** |
||
45 | * Get Twitter direct message receiver. |
||
46 | * |
||
47 | * @param TwitterOAuth $twitter |
||
48 | * @return string |
||
49 | * @throws CouldNotSendNotification |
||
50 | */ |
||
51 | 4 | public function getReceiver(TwitterOAuth $twitter) |
|
69 | |||
70 | /** |
||
71 | * Return Twitter direct message api endpoint. |
||
72 | * |
||
73 | * @return string |
||
74 | */ |
||
75 | 1 | public function getApiEndpoint() |
|
79 | |||
80 | /** |
||
81 | * Build Twitter request body. |
||
82 | * |
||
83 | * @param TwitterOAuth $twitter |
||
84 | * @return array |
||
85 | * @throws CouldNotSendNotification |
||
86 | */ |
||
87 | 1 | public function getRequestBody(TwitterOAuth $twitter) |
|
103 | } |
||
104 |