修改图文消息.

@param string $mediaId
@param array  $articles
@param int    $agentId

@return bool
507446
public function updateNews($mediaId, array $articles, $agentId = 0)
    {
        $params = array(
                   'media_id' => $mediaId,
                   'agentid' => $agentId,
                   'mpnews'=>array('articles'=>$articles),
                  );

        return $this->http->jsonPost(self::API_FOREVER_NEWS_UPDATE, $params);
    }
960202
public function unassignMedia($mediaId)
    {
        $this->getLogger()->info('Unassigning media ID ' . json_encode($mediaId) . ' From display Group ID ' . $this->displayGroupId);
        $this->doPost('/displaygroup/' . $this->displayGroupId . '/media/unassign', [
            'mediaId' => $mediaId
            ]);

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

        return $response->getBody();
    }
261256
public function getMedia($mediaId)
    {
        $result = $this->httpGet(self::WECHAT_MEDIA_GET_PREFIX, [
            'access_token' => $this->getAccessToken(),
            'media_id' => $mediaId
        ]);
        return is_string($result) ? $result : false;
    }
1297664
function getMediaItem($itemId)
    {
        $params = array(1, $this->username, $this->password, $itemId);

        return $this->sendRequest('wp.getMediaItem', $params);
    }
84874
public function set($agentId, array $agentInfo = [])
    {
        $params = array_merge($agentInfo, [
            'agentid' => $agentId,
        ]);

        return $this->parseJSON('json', [self::API_SET, $params]);
    }
583858
public function toOpenId($userId, $agentId)
    {
        $params = [
            'userid'  => $userId,
            'agentid' => $agentId,
        ];

        return $this->parseJSON('json', [self::API_TO_OPENID, $params]);
    }
146295
public function findMediaByCategoryId(int $catId = null)
    {
        if (null === $catId) {
            return;
        }

        $this->sql = <<<SQL
select
    mc.category,
    m.id,
    m.file,
    m.caption
from media_category mc
join media_category_map mcp on mc.id = mcp.category_id
join media m on mcp.media_id = m.id
where mc.id = ?
SQL;
        $this->bindValues[] = $catId;
        return $this->find();
    }
1314182
protected function addMediaToEntity($entityName, $id, $mediaId)
    {
        try {
            $em = $this->getDoctrine()->getManager();
            $entity = $em->getRepository($entityName)->find($id);
            $media = $this->container->get('sulu.repository.media')->find($mediaId);

            if (!$entity) {
                throw new EntityNotFoundException($entityName, $id);
            }

            if (!$media) {
                throw new EntityNotFoundException($this->getParameter('sulu.model.media.class'), $mediaId);
            }

            if ($entity->getMedias()->contains($media)) {
                throw new RestException('Relation already exists');
            }

            $entity->addMedia($media);
            $em->flush();

            $view = $this->view(
                new Media(
                    $media,
                    $this->getUser()->getLocale(),
                    null
                ),
                200
            );
        } catch (EntityNotFoundException $enfe) {
            $view = $this->view($enfe->toArray(), 404);
        } catch (RestException $exc) {
            $view = $this->view($exc->toArray(), 400);
        } catch (\Exception $e) {
            $view = $this->view($e->getMessage(), 400);
        }

        return $this->handleView($view);
    }
931332
public function download($mediaId)
    {
        $response = $this->curl->post(self::DOWNLOAD.$this->access_token, json_encode([
                    'media_id' => $mediaId,
                ]
            )
        );
        $is_json = json_decode($response);
        if ($is_json) {
            return Response::json($is_json);
        } else {
            return $response;
        }
    }
75527
public function produce( $packetName, $articles )
	{
		if( !in_array( $packetName, $this->packets ) )
			throw new InvalidArgumentException( 'Packet "'.$packetName.'" is not a valid Packet.' );
		try
		{
			$packet	= new Alg_Parcel_Packet( $packetName );
			foreach( $articles as $articleName => $articleQuantity )
			{
				if( !in_array( $articleName, $this->articles ) )
					throw new InvalidArgumentException( 'Article "'.$articleName.'" is not a valid Article.' );
				for( $i=0; $i<$articleQuantity; $i++ )
				{
					$volume	= $this->volumes[$packetName][$articleName];
					$packet->addArticle( $articleName, $volume );
				}
			}
			return $packet;
		}
		catch( OutOfRangeException $e )
		{
			throw new OutOfRangeException( 'To much Articles for Packet.' ); 
		}
	}
989849
public function postDelete($mediaId)
    {
        $media = Media::findOrFail($mediaId);
        $media->delete();

        return redirect($this->admin->currentUrl())->with('notifications_below_header', [['type' => 'success', 'icon' => 'check-circle', 'title' => 'Success!', 'message' => 'The Media was successfully deleted.', 'dismissable' => false]]);
    }
4849
public function add($agentId, array $buttons)
    {
        return $this->parseJSON('json', [self::API_CREATE, ['button' => $buttons], JSON_UNESCAPED_UNICODE, ['agentid' => $agentId]]);
    }
778645
public function getMenu($agentId)
    {
        $result = $this->httpGet(self::WECHAT_MENU_GET_PREFIX, [
            'access_token' => $this->getAccessToken(),
            'agentid' => $agentId
        ]);
        return isset($result['menu']['button']) ? $result['menu']['button'] : false;
    }
913019
public function deleteAction($mediaId)
    {
        $em = $this->getDoctrine()->getManager();

        /* @var Media $media */
        $media = $em->getRepository('VictoireMediaBundle:Media')->getMedia($mediaId);
        $medianame = $media->getName();
        $folder = $media->getFolder();

        $em->getRepository('VictoireMediaBundle:Media')->delete($media);

        $this->congrat('Entry \''.$medianame.'\' has been deleted!');

        return new RedirectResponse($this->generateUrl('VictoireMediaBundle_folder_show', ['folderId' => $folder->getId()]));
    }
52245
public Article addMediaContent(MediaContent mediaContent) {
		if(mediaContent == null)
			return this;

		if(this.mediaContentVec == null)
			this.mediaContentVec = new Vector<>();

		this.mediaContentVec.add(mediaContent);

		return this;
	}
944845
public function removeAction($mediaId)
    {
        $media = $this->getMedia($mediaId);
        $request = $this->getRequest();
        if ($request->request->get('confirm') === 'yes' || $request->get('confirm') === 'yes')
        {
            $this->get('fulgurio_light_cms.media_library')->remove($media);
            $em = $this->getDoctrine()->getManager();
            $em->remove($media);
            $em->flush();
            return $this->redirect($this->generateUrl('AdminMedias'));
        }
        else if ($request->request->get('confirm') === 'no')
        {
            return $this->redirect($this->generateUrl('AdminMedias', array('mediaId' => $mediaId)));
        }
        $templateName = $request->isXmlHttpRequest() ? 'FulgurioLightCMSBundle::adminConfirmAjax.html.twig' : 'FulgurioLightCMSBundle::adminConfirm.html.twig';
        return $this->render($templateName, array(
            'action' => $this->generateUrl('AdminMediasRemove', array('mediaId' => $mediaId)),
            'confirmationMessage' => $this->get('translator')->trans('fulgurio.lightcms.medias.delete_confirm_message', array('%FILENAME%' => $media->getOriginalName()), 'admin'),
        ));
    }