Version 1
[yaffs-website] / vendor / php-instagram-api / php-instagram-api / Instagram / Collection / UserCollection.php
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 namespace Instagram\Collection;
10
11 /**
12  * User Collection
13  *
14  * Holds a collection of users
15  */
16 class UserCollection extends \Instagram\Collection\CollectionAbstract {
17
18     /**
19      * Set the collection data
20      *
21      * @param StdClass $raw_data
22      * @access public
23      */
24     public function setData( $raw_data ) {
25         $this->data = $raw_data->data;
26         $this->pagination = isset( $raw_data->pagination ) ? $raw_data->pagination : null;
27         $this->convertData( '\Instagram\User' );
28     }
29
30     /**
31      * Get next max cursor
32      *
33      * Get the next max cursor for use in pagination
34      *
35      * @return string Returns the next max cursor
36      * @access public
37      */
38     public function getNextCursor() {
39         return isset( $this->pagination->next_cursor ) && !empty( $this->pagination->next_cursor ) ? $this->pagination->next_cursor : null;
40     }
41
42     /**
43      * Get next max cursor
44      *
45      * Get the next max cursor for use in pagination
46      *
47      * @return string Returns the next max cursor
48      * @access public
49      */
50     public function getNext() {
51         return $this->getNextCursor();
52     }
53
54 }