1 | <?php |
||
13 | class Sms |
||
14 | { |
||
15 | protected $driver; |
||
16 | protected $config; |
||
17 | |||
18 | 33 | public function __construct(SendsSms $driver = null) |
|
23 | |||
24 | /** |
||
25 | * Returns a SMS driver instance |
||
26 | * @param mixed $driver An existing SMS driver instance to use |
||
27 | * @return \LeadThread\Sms\Interfaces\SendsSms |
||
28 | */ |
||
29 | 33 | protected function getDriver($driver = null) |
|
37 | |||
38 | /** |
||
39 | * Sends an SMS message |
||
40 | * @param string $msg The message to send |
||
41 | * @param mixed $to The number to send to |
||
42 | * @param number $from The number to send from |
||
43 | * @return mixed The response of the message |
||
44 | */ |
||
45 | 27 | public function send($msg, $to, $from = null) |
|
53 | |||
54 | /** |
||
55 | * Sends the same message from the same number to many phone numbers |
||
56 | * @param string $msg The message to send |
||
57 | * @param array $tos An array of numbers to send to |
||
58 | * @param number $from The number to send from |
||
59 | * @return array An array of responses per number |
||
60 | */ |
||
61 | 9 | public function sendMany($msg, array $tos, $from = null) |
|
69 | |||
70 | /** |
||
71 | * An array of SMS items to send |
||
72 | * @param array $data Must contain msg, to, and from keys per item |
||
73 | * @return array An array of responses per item |
||
74 | */ |
||
75 | 9 | public function sendArray(array $data) |
|
83 | |||
84 | protected function getSearchParams($search) |
||
92 | |||
93 | /** |
||
94 | * Searches for a number and then purchases the first one it finds |
||
95 | * @param array $search Array of search options |
||
96 | * @return \LeadThread\Sms\Responses\Response |
||
97 | */ |
||
98 | public function searchAndBuyNumber($search) |
||
102 | |||
103 | public function searchNumber($search) |
||
107 | |||
108 | public function buyNumber($number) |
||
112 | |||
113 | public function sellNumber($number) |
||
117 | } |
||
118 |