5 * @author Galen Grover <galenjr@gmail.com>
6 * @license http://opensource.org/licenses/mit-license.php The MIT License
9 namespace Instagram\Collection;
14 * Holds a collection of media
16 class MediaCollection extends \Instagram\Collection\CollectionAbstract {
19 * Set the collection data
21 * @param StdClass $raw_data
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' );
33 * Get the next max id for use in pagination
35 * @return string Returns the next max id
38 public function getNextMaxId() {
39 return isset( $this->pagination->next_max_id ) ? $this->pagination->next_max_id : null;
45 * Get the API url for the next page of media
46 * You shouldn't need to use this
48 * @return string Returns the next url
51 public function getNextUrl() {
52 return isset( $this->pagination->next_url ) ? $this->pagination->next_url : null;
58 * Get the next max id for use in pagination
60 * @return string Returns the next max id
63 public function getNext() {
64 return $this->getNextMaxId();