Fetch item from WeChat server.

@param string $mediaId

@throws \EntWeChat\Core\Exceptions\RuntimeException

@return mixed
769381
public function getStream($mediaId)
    {
        $response = $this->getHttp()->get(self::API_GET, ['media_id' => $mediaId]);

        return $response->getBody();
    }
51772
public MediaItem getMediaItem(String id) {
		
		DailyMotionUrl url = new DailyMotionUrl(requestPrefix + id);
		
		HttpRequest request;
		try {
			request = requestFactory.buildGetRequest(url);
			DailyMotionVideo video = request.execute().parseAs(DailyMotionVideo.class);
			
			if(video != null) {
				MediaItem mediaItem = new DailyMotionMediaItem(video);
				return mediaItem;
			}
			
		} catch (Exception e) {
			
		}

		return null;
	}
502979
public function download($media_id)
    {
        $url = 'https://api.weixin.qq.com/cgi-bin/media/get?'.$this->access_token.'&media_id='.$media_id;

        return $this->curl->get($url);
    }
1262965
public static function media_get($access_token, $media_id)
    {
        $url = static::cgi_media_uri($access_token, $media_id);

        $ch = curl_init($url);
        curl_setopt($ch, CURLOPT_HEADER, 0);
        curl_setopt($ch, CURLOPT_NOBODY, 0);    //只取body头
        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
        curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        $package = curl_exec($ch);
        $httpinfo = curl_getinfo($ch);
        curl_close($ch);
        $imageAll = array_merge(array('header' => $httpinfo), array('body' => $package));

        return $imageAll;

    }
819517
public function delete($mediaId)
    {
        return Response::json($this->curl->post(self::DELETE.$this->access_token, json_encode([
                    'media_id' => $mediaId,
                ]
            )
        )
        );
    }
948178
def get(self, media_id):
        
        response = self._get('item', format_dict=dict(media_id=media_id))
        return VoicebaseMedia(response, api=self.api)
576889
public function batchSyncUser($mediaId, $callback = [])
    {
        $params = [
            'media_id' => $mediaId,
            'callback' => $callback,
        ];

        return $this->parseJSON('json', [self::API_SYNC_USER, $params]);
    }
383610
public function get($clientId)
    {
        if (!isset($this->clients[$clientId])) {
            throw new \RuntimeException('Client with id '.$clientId.' does not exist.');
        }

        return $this->clients[$clientId];
    }
216828
public function get($pageId, array $params = array())
    {
        $endpoint = '/admin/pages/'.$pageId.'.json';
        $response = $this->request($endpoint, 'GET', $params);
        return $this->createObject(Page::class, $response['page']);
    }
559050
public function getResource($resourceId)
    {
        if (isset($this->resources[$resourceId])) {
            return $this->resources[$resourceId];
        }

        $dynamicResource = $this->dynamicResourceMapper($resourceId);

        if (!empty($dynamicResource)) {
            return $dynamicResource;
        }

        return null;
    }
1014537
public function getMaterial($media_id) {
		$data = $this->getData('/cgi-bin/material/get_material', [
			'access_token' => $this->getAccessToken(),
		], Json::encode(['media_id' => $media_id]));

		return $this->errcode == 0 ? (isset($data['content']) && isset($data['extension']) ? $this->saveFile($data) : $data) : null;
	}
813461
private function getMedia($mediaId)
    {
        $page = $this->getDoctrine()
                ->getRepository('FulgurioLightCMSBundle:Media')
                ->findOneBy(array('id' => $mediaId));
        if ($page)
        {
            return $page;
        }
        throw new NotFoundHttpException(
            $this->get('translator')->trans('fulgurio.lightcms.medias.not_found', array(), 'admin')
        );
    }
1215923
public function voice($mediaid = '')
    {
        $this->message = [
            'CreateTime'   => time(),
            'MsgType'      => 'voice',
            'ToUserName'   => $this->getOpenid(),
            'FromUserName' => $this->getToOpenid(),
            'Voice'        => ['MediaId' => $mediaid],
        ];
        return $this;
    }
733563
public function downloadMedia($mediaId)
    {
        $result = $this->_curl("https://qyapi.weixin.qq.com/cgi-bin/media/get?access_token={$this->getAccessToken()}&media_id={$mediaId}");

        $match = [];

        preg_match_all('/\nContent-disposition: ?attachment; ?filename="([^"]*?)"/ism', $result['head'], $match);

        return [
            'filename' => $match[1][0],
            'content' => $result['body'],
        ];
    }
220780
public function getItem(string $cacheId)
    {
        if (!$this->cache->has($cacheId)) {
            return null;
        }

        $data = $this->cache->get($cacheId);

        if (!is_array($data) || !array_key_exists('content', $data)) {
            return null;
        }

        return unserialize($data['content']);
    }
682775
public function get($cacheId)
    {
        $this->throwExceptionIfNotExists($cacheId);

        if ($this->expired($cacheId)) {
            return $this->getFromCacheable($cacheId);
        }

        return $this->getCachedItem($cacheId);
    }
579699
public function chatGet($chatid) {
        $result = $this->httpGet(self::WECHAT_MENU_DELETE_PREFIX, [
            'access_token' => $this->getAccessToken(),
            'chatid' => $chatid,
        ]);
        return ($result['errmsg'] == 'ok') ? $result['chat_info'] : $result['errmsg'];
    }