Пример #1
0
 /**
  * Assemble variant image data 
  * 
  * @param \XLite\Module\XC\ProductVariants\Model\Image\ProductVariant\Image $image Image
  *  
  * @return array
  */
 protected function assembleVariantImageData(\XLite\Model\Base\Image $image)
 {
     $result = array('full' => array($image->getWidth(), $image->getHeight(), $image->getURL(), $image->getAlt()));
     foreach ($this->getImageSizes() as $name => $sizes) {
         $result[$name] = $image->getResizedURL($sizes[0], $sizes[1]);
         $result[$name][3] = $image->getAlt();
     }
     return $result;
 }
Пример #2
0
 /**
  * Set image
  *
  * @param \XLite\Model\Base\Image $image Image
  *
  * @return boolean
  */
 public function setImage(\XLite\Model\Base\Image $image)
 {
     $this->mimeType = $image->getMime();
     $this->width = $image->getWidth();
     $this->height = $image->getHeight();
     return true;
 }