getOriginalAsset() публичный Метод

Returns the original image this variant is based on
public getOriginalAsset ( ) : Image
Результат Image
 /**
  * @param ImageVariant $imageVariant
  * @return array
  */
 protected function getImageVariantPreviewData(ImageVariant $imageVariant)
 {
     $image = $imageVariant->getOriginalAsset();
     $imageProperties = $this->getImagePreviewData($image);
     return $imageProperties;
 }
Пример #2
0
 /**
  * Adds a variant of this image
  *
  * Note that you should try to re-use variants if you need to adjust them, rather than creating a new
  * variant for every change. Non-used variants will remain in the database and block resource disk space
  * until they are removed explicitly or the original image is deleted.
  *
  * @param ImageVariant $variant The new variant
  * @return void
  * @throws \InvalidArgumentException
  */
 public function addVariant(ImageVariant $variant)
 {
     if ($variant->getOriginalAsset() !== $this) {
         throw new \InvalidArgumentException('Could not add the given ImageVariant to the list of this Image\'s variants because the variant refers to a different original asset.', 1381416726);
     }
     $this->variants->add($variant);
 }