5 * @author Galen Grover <galenjr@gmail.com>
6 * @license http://opensource.org/licenses/mit-license.php The MIT License
9 namespace Instagram\Collection;
12 * Media Search Collection
14 * Holds a collection of searched media
16 class MediaSearchCollection extends \Instagram\Collection\CollectionAbstract {
19 * Next max timestamp for use in pagination
24 protected $next_max_timestamp;
27 * Set the collection data
29 * @param StdClass $raw_data
32 public function setData( $raw_data ) {
33 $this->data = $raw_data->data;
34 $this->convertData( '\Instagram\Media' );
35 $this->next_max_timestamp = count( $this->data ) ? $this->data[ count( $this->data )-1 ]->getCreatedTime() : null;
39 * Get next max timestamp
41 * Get the next max timestamp for use in pagination
43 * @return string Returns the next max timestamp
46 public function getNextMaxTimeStamp() {
47 return $this->next_max_timestamp;
51 * Get next max timestamp
53 * Get the next max timestamp for use in pagination
55 * @return string Returns the next max timestamp
58 public function getNext() {
59 return $this->getNextMaxTimeStamp();