1 : <?php
2 :
3 : class Services_Twilio_Rest_AvailablePhoneNumbers
4 : extends Services_Twilio_ListResource
5 : {
6 : public function getLocal($country)
7 : {
8 1 : $curried = new Services_Twilio_PartialApplicationHelper();
9 1 : $curried->set(
10 1 : 'getList',
11 1 : array($this, 'getList'),
12 1 : array($country, 'Local')
13 1 : );
14 1 : return $curried;
15 : }
16 : public function getTollFree($country)
17 : {
18 0 : $curried = new Services_Twilio_PartialApplicationHelper();
19 0 : $curried->set(
20 0 : 'getList',
21 0 : array($this, 'getList'),
22 0 : array($country, 'TollFree')
23 0 : );
24 0 : return $curried;
25 : }
26 : /**
27 : * Get a list of available phone numbers.
28 : *
29 : * @param string country The 2-digit country code you'd like to search for
30 : * numbers e.g. ('US', 'CA', 'GB')
31 : * @param string type The type of number ('Local' or 'TollFree')
32 : * @return object The object representation of the resource
33 : */
34 :
35 : public function getList($country, $type, array $params = array())
36 : {
37 1 : return $this->retrieveData("$country/$type", $params);
38 : }
39 :
40 : public function getSchema()
41 : {
42 : // You can't page through the list of available phone numbers.
43 2 : return array('list' => 'countries') + parent::getSchema();
44 : }
45 : }
|