Line | |
---|
1 | <?php |
---|
2 | |
---|
3 | /** |
---|
4 | * Instagram PHP |
---|
5 | * @author Galen Grover <galenjr@gmail.com> |
---|
6 | * @license http://opensource.org/licenses/mit-license.php The MIT License |
---|
7 | */ |
---|
8 | |
---|
9 | |
---|
10 | include_once(INSTAGRAM_ROOT.'/Collection/CollectionAbstract.php'); |
---|
11 | include_once(INSTAGRAM_ROOT.'/User.php'); |
---|
12 | |
---|
13 | |
---|
14 | /** |
---|
15 | * User Collection |
---|
16 | * |
---|
17 | * Holds a collection of users |
---|
18 | */ |
---|
19 | class Instagram_Collection_UserCollection extends Instagram_Collection_CollectionAbstract { |
---|
20 | |
---|
21 | /** |
---|
22 | * Set the collection data |
---|
23 | * |
---|
24 | * @param StdClass $raw_data |
---|
25 | * @access public |
---|
26 | */ |
---|
27 | public function setData( $raw_data ) { |
---|
28 | $this->data = $raw_data->data; |
---|
29 | $this->pagination = isset( $raw_data->pagination ) ? $raw_data->pagination : null; |
---|
30 | $this->convertData( 'Instagram_User' ); |
---|
31 | } |
---|
32 | |
---|
33 | /** |
---|
34 | * Get next max cursor |
---|
35 | * |
---|
36 | * Get the next max cursor for use in pagination |
---|
37 | * |
---|
38 | * @return string Returns the next max cursor |
---|
39 | * @access public |
---|
40 | */ |
---|
41 | public function getNextCursor() { |
---|
42 | return isset( $this->pagination->next_cursor ) && !empty( $this->pagination->next_cursor ) ? $this->pagination->next_cursor : null; |
---|
43 | } |
---|
44 | |
---|
45 | /** |
---|
46 | * Get next max cursor |
---|
47 | * |
---|
48 | * Get the next max cursor for use in pagination |
---|
49 | * |
---|
50 | * @return string Returns the next max cursor |
---|
51 | * @access public |
---|
52 | */ |
---|
53 | public function getNext() { |
---|
54 | return $this->getNextCursor(); |
---|
55 | } |
---|
56 | |
---|
57 | } |
---|
58 | ?> |
---|
Note: See
TracBrowser
for help on using the repository browser.