Version 1
[yaffs-website] / vendor / php-instagram-api / php-instagram-api / Instagram / Collection / UserCollection.php
diff --git a/vendor/php-instagram-api/php-instagram-api/Instagram/Collection/UserCollection.php b/vendor/php-instagram-api/php-instagram-api/Instagram/Collection/UserCollection.php
new file mode 100644 (file)
index 0000000..a558133
--- /dev/null
@@ -0,0 +1,54 @@
+<?php
+
+/**
+* Instagram PHP
+* @author Galen Grover <galenjr@gmail.com>
+* @license http://opensource.org/licenses/mit-license.php The MIT License
+*/
+
+namespace Instagram\Collection;
+
+/**
+ * User Collection
+ *
+ * Holds a collection of users
+ */
+class UserCollection extends \Instagram\Collection\CollectionAbstract {
+
+    /**
+     * Set the collection data
+     *
+     * @param StdClass $raw_data
+     * @access public
+     */
+    public function setData( $raw_data ) {
+        $this->data = $raw_data->data;
+        $this->pagination = isset( $raw_data->pagination ) ? $raw_data->pagination : null;
+        $this->convertData( '\Instagram\User' );
+    }
+
+    /**
+     * Get next max cursor
+     *
+     * Get the next max cursor for use in pagination
+     *
+     * @return string Returns the next max cursor
+     * @access public
+     */
+    public function getNextCursor() {
+        return isset( $this->pagination->next_cursor ) && !empty( $this->pagination->next_cursor ) ? $this->pagination->next_cursor : null;
+    }
+
+    /**
+     * Get next max cursor
+     *
+     * Get the next max cursor for use in pagination
+     *
+     * @return string Returns the next max cursor
+     * @access public
+     */
+    public function getNext() {
+        return $this->getNextCursor();
+    }
+
+}
\ No newline at end of file