Class Mage_Catalog_Model_Product_Attribute_Backend_Media

Description

Catalog product media gallery attribute backend model

Located in /Catalog/Model/Product/Attribute/Backend/Media.php (line 34)

Mage_Eav_Model_Entity_Attribute_Backend_Abstract
   |
   --Mage_Catalog_Model_Product_Attribute_Backend_Media
Variable Summary
Method Summary
string addImage (Mage_Catalog_Model_Product $product, string $file, [string|array $mediaAttribute = null], [boolean $move = false], [boolean $exclude = true])
array addImagesWithDifferentMediaAttributes (Mage_Catalog_Model_Product $product, array $fileAndAttributesArray, [string $filePath = ''], [boolean $move = false], [boolean $exclude = true])
void afterSave ( $object)
void beforeSave ( $object)
void duplicate ( $object)
array|boolean getImage (Mage_Catalog_Model_Product $product, string $file)
string getRenamedImage (string $file)
Mage_Catalog_Model_Product_Attribute_Backend_Media setMediaAttribute (Mage_Catalog_Model_Product $product, string|array $mediaAttribute, string $value)
string _copyImage (string $file)
void _getDefaultValue ( $key,  &$image)
String _getNotDuplicatedFilename (String $fileName, String $dispretionPath)
string _getUniqueFileName ( $file,  $dirsep)
string _moveImageFromTmp (string $file)
Variables
Methods
addImage (line 243)

Add image to media gallery and return new filename

  • access: public
string addImage (Mage_Catalog_Model_Product $product, string $file, [string|array $mediaAttribute = null], [boolean $move = false], [boolean $exclude = true])
  • Mage_Catalog_Model_Product $product
  • string $file: file path of image in file system
  • string|array $mediaAttribute: code of attribute with type 'media_image', leave blank if image should be only in gallery
  • boolean $move: if true, it will move source file
  • boolean $exclude: mark image as disabled in product page view
addImagesWithDifferentMediaAttributes (line 331)

Add images with different media attributes.

Image will be added only once if the same image is used with different media attributes

  • return: array of parallel arrays with original and renamed files
  • access: public
array addImagesWithDifferentMediaAttributes (Mage_Catalog_Model_Product $product, array $fileAndAttributesArray, [string $filePath = ''], [boolean $move = false], [boolean $exclude = true])
  • Mage_Catalog_Model_Product $product
  • array $fileAndAttributesArray: array of arrays of filename and corresponding media attribute
  • string $filePath: path, where image cand be found
  • boolean $move: if true, it will move source file
  • boolean $exclude: mark image as disabled in product page view
afterLoad (line 43)

Load attribute data after product loaded

  • access: public
void afterLoad (Mage_Catalog_Model_Product $object)

Redefinition of:
Mage_Eav_Model_Entity_Attribute_Backend_Abstract::afterLoad()
afterSave (line 186)
  • access: public
void afterSave ( $object)
  • $object

Redefinition of:
Mage_Eav_Model_Entity_Attribute_Backend_Abstract::afterSave()
beforeSave (line 99)
  • access: public
void beforeSave ( $object)
  • $object

Redefinition of:
Mage_Eav_Model_Entity_Attribute_Backend_Abstract::beforeSave()
clearMediaAttribute (line 454)

Clear media attribute value

  • access: public
Mage_Catalog_Model_Product_Attribute_Backend_Media clearMediaAttribute (Mage_Catalog_Model_Product $product, string|array $mediaAttribute)
duplicate (line 617)
  • access: public
void duplicate ( $object)
  • $object
getImage (line 430)

Retrive image from gallery

  • access: public
array|boolean getImage (Mage_Catalog_Model_Product $product, string $file)
getRenamedImage (line 177)

Retrieve renamed image name

  • access: public
string getRenamedImage (string $file)
  • string $file
removeImage (line 402)

Remove image from gallery

  • access: public
setMediaAttribute (line 479)

Set media attribute value

  • access: public
Mage_Catalog_Model_Product_Attribute_Backend_Media setMediaAttribute (Mage_Catalog_Model_Product $product, string|array $mediaAttribute, string $value)
updateImage (line 364)

Update image in gallery

  • access: public
Mage_Catalog_Model_Product_Attribute_Backend_Media updateImage (Mage_Catalog_Model_Product $product, sting $file, array $data)
validate (line 79)

Validate media_gallery attribute data

  • throws: Mage_Core_Exception
  • access: public
bool validate (Mage_Catalog_Model_Product $object)

Redefinition of:
Mage_Eav_Model_Entity_Attribute_Backend_Abstract::validate()
_copyImage (line 582)

Copy image and return new filename.

  • access: protected
string _copyImage (string $file)
  • string $file
_getConfig (line 511)

Retrive media config

  • access: protected
_getDefaultValue (line 63)
  • access: protected
void _getDefaultValue ( $key,  &$image)
  • $key
  • &$image
_getNotDuplicatedFilename (line 643)

Get filename which is not duplicated with other files in media temporary and media directories

  • access: protected
String _getNotDuplicatedFilename (String $fileName, String $dispretionPath)
  • String $fileName
  • String $dispretionPath
_getResource (line 501)

Retrieve resource model

  • access: protected
_getUniqueFileName (line 561)

Check whether file to move exists. Getting unique name

  • access: protected
string _getUniqueFileName ( $file,  $dirsep)
  • $file
  • $dirsep
_moveImageFromTmp (line 522)

Move image from temporary directory to normal

  • access: protected
string _moveImageFromTmp (string $file)
  • string $file

Inherited Methods

Inherited From Mage_Eav_Model_Entity_Attribute_Backend_Abstract

Mage_Eav_Model_Entity_Attribute_Backend_Abstract::afterDelete()
Mage_Eav_Model_Entity_Attribute_Backend_Abstract::afterLoad()
Mage_Eav_Model_Entity_Attribute_Backend_Abstract::afterSave()
Mage_Eav_Model_Entity_Attribute_Backend_Abstract::beforeDelete()
Mage_Eav_Model_Entity_Attribute_Backend_Abstract::beforeSave()
Mage_Eav_Model_Entity_Attribute_Backend_Abstract::getAttribute()
Mage_Eav_Model_Entity_Attribute_Backend_Abstract::getDefaultValue()
Mage_Eav_Model_Entity_Attribute_Backend_Abstract::getEntityIdField()
Mage_Eav_Model_Entity_Attribute_Backend_Abstract::getTable()
Mage_Eav_Model_Entity_Attribute_Backend_Abstract::getType()
Mage_Eav_Model_Entity_Attribute_Backend_Abstract::getValueId()
Mage_Eav_Model_Entity_Attribute_Backend_Abstract::isStatic()
Mage_Eav_Model_Entity_Attribute_Backend_Abstract::setAttribute()
Mage_Eav_Model_Entity_Attribute_Backend_Abstract::setValueId()
Mage_Eav_Model_Entity_Attribute_Backend_Abstract::validate()

Documentation generated on Fri, 11 Feb 2011 17:08:23 +0200 by phpDocumentor 1.4.3