/** * Construct */ public function __construct() { parent::__construct(); $this->setProviderName('zym_media.provider.image'); }
/** * @throws NotFoundHttpException * * @param Entity\Media $media * @param string $format * * @return Response * * @ParamConverter("media", class="ZymMediaBundle:Media") * @SecureParam(name="media", permissions="VIEW") */ public function downloadAction(Entity\Media $media, $format = 'reference') { /** @var MediaPool */ $mediaPool = $this->get('zym_media.media_pool'); $provider = $mediaPool->getProvider($media->getProviderName()); $response = $provider->getDownloadResponse($media, $format, $mediaPool->getDownloadMode($media)); return $response; }