/var/www/hkosl.com/littleark/webadmin/libraies/twilio/sdk/Services/Twilio/Page.php


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<?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();
    }
}