593ea2e8317ebd795ecf8c4b461dd09934649b05
[yaffs-website] / vendor / php-instagram-api / php-instagram-api / Instagram / Collection / MediaCollection.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  * Media Collection
13  *
14  * Holds a collection of media
15  */
16 class MediaCollection 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\Media' );
28     }
29
30     /**
31      * Get next max id
32      *
33      * Get the next max id for use in pagination
34      *
35      * @return string Returns the next max id
36      * @access public
37      */
38     public function getNextMaxId() {
39         return isset( $this->pagination->next_max_id ) ? $this->pagination->next_max_id : null;
40     }
41
42     /**
43      * Get next url
44      *
45      * Get the API url for the next page of media
46      * You shouldn't need to use this
47      *
48      * @return string Returns the next url
49      * @access public
50      */
51     public function getNextUrl() {
52         return isset( $this->pagination->next_url ) ? $this->pagination->next_url : null;
53     }
54
55     /**
56      * Get next max id
57      *
58      * Get the next max id for use in pagination
59      *
60      * @return string Returns the next max id
61      * @access public
62      */
63     public function getNext() {
64         return $this->getNextMaxId();
65     }
66
67 }