X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=vendor%2Fphp-instagram-api%2Fphp-instagram-api%2FInstagram%2FCollection%2FTagCollection.php;fp=vendor%2Fphp-instagram-api%2Fphp-instagram-api%2FInstagram%2FCollection%2FTagCollection.php;h=78a8d0fb46e648f9fab7fd62e4edfa93b67ce806;hp=0000000000000000000000000000000000000000;hb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;hpb=57c063afa3f66b07c4bbddc2d6129a96d90f0aad diff --git a/vendor/php-instagram-api/php-instagram-api/Instagram/Collection/TagCollection.php b/vendor/php-instagram-api/php-instagram-api/Instagram/Collection/TagCollection.php new file mode 100644 index 000000000..78a8d0fb4 --- /dev/null +++ b/vendor/php-instagram-api/php-instagram-api/Instagram/Collection/TagCollection.php @@ -0,0 +1,48 @@ + +* @license http://opensource.org/licenses/mit-license.php The MIT License +*/ + +namespace Instagram\Collection; + +/** + * Tag Collection + * + * Holds a collection of tags + */ +class TagCollection extends \Instagram\Collection\CollectionAbstract { + + /** + * Set the collection data + * + * @param StdClass $raw_data + * @access public + */ + public function setData( $raw_data ) { + if ( isset( $raw_data->data ) ) { + $this->data = $raw_data->data; + } + elseif( is_array( $raw_data ) ) { + $this->data = array_map( function( $t ){ return (object)array( 'name' => $t ); }, $raw_data ); + } + $this->convertData( '\Instagram\Tag' ); + } + + /** + * Get an array of tag names + * + * @return array Returns an array of tags + * @access public + */ + public function toArray() { + $tags = array(); + foreach( $this->data as $tag ) { + $tags[] = $tag->getName(); + } + return $tags; + } + +} \ No newline at end of file