/** * @link https://instagram.com/developer/endpoints/media/#get_media * Get information about a media object. The returned type key will allow you to differentiate between image and video media. * * @param string $mediaId * @return Entity\Media|bool * @throws \Exception */ public function getMedia($mediaId) { $result = $this->request('media/' . $mediaId, [], true); if ($result) { $hydrator = new \SocialConnect\Common\Hydrator\ObjectMap(array()); return $hydrator->hydrate(new Entity\Media(), $result); } return false; }
/** * Get a single repository * * @link https://developer.github.com/v3/repos/#get * * @param $username * @param string $owner * @param string $repo * @return Entity\Repository|bool false if it's not exists * @throws \Exception */ public function getRepository($owner, $repo) { try { $result = $this->request('repos/' . $owner . '/' . $repo); $hydrator = new \SocialConnect\Common\Hydrator\ObjectMap(array()); return $hydrator->hydrate(new Entity\Repository(), $result); } catch (\Exception $e) { return false; } }