コード例 #1
0
 /**
  * {@inheritdoc}
  */
 public function generatePrivateUrl(MediaProviderInterface $provider, MediaInterface $media, $format)
 {
     if ('reference' === $format) {
         return $provider->getReferenceImage($media);
     }
     return sprintf('%s/thumb_%s_%s.%s', $provider->generatePath($media), $media->getId(), $format, $this->getExtension($media));
 }
コード例 #2
0
 /**
  * {@inheritdoc}
  */
 public function generatePrivateUrl(MediaProviderInterface $provider, MediaInterface $media, $format)
 {
     if ($format != 'reference') {
         throw new \RuntimeException('No private url for LiipImagineThumbnail');
     }
     $path = $provider->getReferenceImage($media);
     return $path;
 }
コード例 #3
0
 /**
  * {@inheritdoc}
  */
 public function generatePublicUrl(MediaProviderInterface $provider, MediaInterface $media, $format)
 {
     if ($format == 'reference') {
         $path = $provider->getReferenceImage($media);
     } else {
         $path = sprintf('%s/thumb_%s_%s.%s', $provider->generatePath($media), $media->getId(), $format, $this->getExtension($media));
     }
     return $path;
 }