X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=vendor%2Fphp-instagram-api%2Fphp-instagram-api%2FInstagram%2FTag.php;fp=vendor%2Fphp-instagram-api%2Fphp-instagram-api%2FInstagram%2FTag.php;h=e95618cb8f2cb1e26ea7cf19bc975b5cafb3d729;hp=0000000000000000000000000000000000000000;hb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;hpb=57c063afa3f66b07c4bbddc2d6129a96d90f0aad diff --git a/vendor/php-instagram-api/php-instagram-api/Instagram/Tag.php b/vendor/php-instagram-api/php-instagram-api/Instagram/Tag.php new file mode 100644 index 000000000..e95618cb8 --- /dev/null +++ b/vendor/php-instagram-api/php-instagram-api/Instagram/Tag.php @@ -0,0 +1,81 @@ + +* @license http://opensource.org/licenses/mit-license.php The MIT License +*/ + +namespace Instagram; + +use \Instagram\Collection\TagMediaCollection; + +/** + * Tag class + * + * @see \Instagram\Instagram->getTag() + * {@link https://github.com/galen/PHP-Instagram-API/blob/master/Examples/tag.php} + * {@link http://galengrover.com/projects/instagram/?example=tag.php} + */ +class Tag extends \Instagram\Core\BaseObjectAbstract { + + /** + * Get tag media + * + * Retrieve the recent media posted with this tag + * + * This can be paginated with the next_max_id param obtained from MediaCollection->getNext() + * + * @param array $params Optional params to pass to the endpoint + * @return \Instagram\Collection\MediaCollection + * @access public + */ + public function getMedia( array $params = null ) { + return new TagMediaCollection( $this->proxy->getTagMedia( $this->getApiId(), $params ), $this->proxy ); + } + + /** + * Get media count + * + * @return int + * @access public + */ + public function getMediaCount() { + return (int)$this->data->media_count; + } + + /** + * Get tag name + * + * @return string + * @access public + */ + public function getName() { + return $this->data->name; + } + + /** + * Get ID + * + * The ID for a tag is it's name, so return the name + * + * @return string + * @access public + */ + public function getId() { + return $this->getName(); + } + + /** + * Magic toString method + * + * Return the tag name + * + * @return string + * @access public + */ + public function __toString() { + return $this->getName(); + } + +} \ No newline at end of file