1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-28 16:30:59 +01:00
phorge-phorge/externals/twilio-php/Services/Twilio/Page.php
Bob Trahan e96c363eef Add SMS support
Summary:
Provides a working SMS implementation with support for Twilio.

This version doesn't really retry if we get any gruff at all. Future versions should retry.

Test Plan: used bin/sms to send messages and look at them.

Reviewers: chad, epriestley

Reviewed By: epriestley

Subscribers: aurelijus, epriestley, Korvin

Maniphest Tasks: T920

Differential Revision: https://secure.phabricator.com/D8930
2014-05-09 12:47:21 -07:00

68 lines
1.4 KiB
PHP
Executable file

<?php
/**
* A representation of a page of resources.
*
* @category Services
* @package Services_Twilio
* @author Neuman Vong <neuman@twilio.com>
* @license http://creativecommons.org/licenses/MIT/ MIT
* @link http://pear.php.net/package/Services_Twilio
*/
class Services_Twilio_Page
implements IteratorAggregate
{
/**
* The item list.
*
* @var array $items
*/
protected $items;
/**
* Constructs a page.
*
* @param object $page The page object
* @param string $name The key of the item list
*/
public function __construct($page, $name, $next_page_uri = null)
{
$this->page = $page;
$this->items = $page->{$name};
$this->next_page_uri = $next_page_uri;
}
/**
* The item list of the page.
*
* @return array A list of instance resources
*/
public function getItems()
{
return $this->items;
}
/**
* Magic method to allow retrieving the properties of the wrapped page.
*
* @param string $prop The property name
*
* @return mixed Could be anything
*/
public function __get($prop)
{
return $this->page->$prop;
}
/**
* Implementation of IteratorAggregate::getIterator().
*
* @return Traversable
*/
public function getIterator()
{
return $this->getItems();
}
}