[ Index ]

PHP Cross Reference of Phabricator

title

Body

[close]

/externals/twilio-php/Services/Twilio/Rest/ -> AvailablePhoneNumbers.php (source)

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


Generated: Sun Nov 30 09:20:46 2014 Cross-referenced by PHPXref 0.7.1