1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- <?php
- class Services_Twilio_Rest_IncomingPhoneNumbers extends Services_Twilio_ListResource {
- function init($client, $uri) {
- $this->setupSubresources(
- 'local',
- 'toll_free',
- 'mobile'
- );
- }
- function create(array $params = array()) {
- return parent::_create($params);
- }
- function getList($type, array $params = array())
- {
- return $this->client->retrieveData($this->uri . "/$type", $params);
- }
-
- public function getNumber($number) {
- $page = $this->getPage(0, 1, array(
- 'PhoneNumber' => $number
- ));
- $items = $page->getItems();
- if (is_null($items) || empty($items)) {
- return null;
- }
- return $items[0];
- }
- }
- class Services_Twilio_Rest_Local extends Services_Twilio_NumberType { }
- class Services_Twilio_Rest_Mobile extends Services_Twilio_NumberType { }
- class Services_Twilio_Rest_TollFree extends Services_Twilio_NumberType { }
|