5 * @author Galen Grover <galenjr@gmail.com>
6 * @license http://opensource.org/licenses/mit-license.php The MIT License
11 use \Instagram\Collection\TagMediaCollection;
16 * @see \Instagram\Instagram->getTag()
17 * {@link https://github.com/galen/PHP-Instagram-API/blob/master/Examples/tag.php}
18 * {@link http://galengrover.com/projects/instagram/?example=tag.php}
20 class Tag extends \Instagram\Core\BaseObjectAbstract {
25 * Retrieve the recent media posted with this tag
27 * This can be paginated with the next_max_id param obtained from MediaCollection->getNext()
29 * @param array $params Optional params to pass to the endpoint
30 * @return \Instagram\Collection\MediaCollection
33 public function getMedia( array $params = null ) {
34 return new TagMediaCollection( $this->proxy->getTagMedia( $this->getApiId(), $params ), $this->proxy );
43 public function getMediaCount() {
44 return (int)$this->data->media_count;
53 public function getName() {
54 return $this->data->name;
60 * The ID for a tag is it's name, so return the name
65 public function getId() {
66 return $this->getName();
70 * Magic toString method
77 public function __toString() {
78 return $this->getName();