Class Mage_Catalog_Model_Product_Attribute_Media_Api

Description

Catalog product media api

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

Mage_Api_Model_Resource_Abstract
   |
   --Mage_Catalog_Model_Api_Resource
      |
      --Mage_Catalog_Model_Product_Attribute_Media_Api
Direct descendents
Class Description
Mage_Catalog_Model_Product_Attribute_Media_Api_V2 Catalog product media api V2
Class Constant Summary
ATTRIBUTE_CODE = 'media_gallery'
Variable Summary
array $_mimeTypes
Method Summary
Mage_Catalog_Model_Product_Attribute_Media_Api __construct ()
string create (int|string $productId, array $data, [string|int $store = null], [ $identifierType = null])
array info (int|string $productId, string $file, [string|int $store = null], [ $identifierType = null])
array items (int|string $productId, [string|int $store = null], [ $identifierType = null])
boolean remove (int|string $productId, string $file, [ $identifierType = null])
array types (int $setId)
boolean update (int|string $productId, string $file, array $data, [string|int $store = null], [ $identifierType = null])
array _imageToArray ( &$image, Mage_Catalog_Model_Product $product, array $image)
Mage_Catalog_Model_Product _initProduct (int|string $productId, [string|int $store = null], [ $identifierType = null])
array _prepareImageData (array $data)
Variables
array $_mimeTypes = array(
'image/jpeg' => 'jpg',
'image/gif' => 'gif',
'image/png' => 'png'
)
(line 47)

Allowed mime types for image

  • access: protected

Inherited Variables

Inherited from Mage_Catalog_Model_Api_Resource

Mage_Catalog_Model_Api_Resource::$_ignoredAttributeCodes
Mage_Catalog_Model_Api_Resource::$_ignoredAttributeTypes
Mage_Catalog_Model_Api_Resource::$_storeIdSessionField

Inherited from Mage_Api_Model_Resource_Abstract

Mage_Api_Model_Resource_Abstract::$_resourceConfig
Methods
Constructor __construct (line 53)
  • access: public
Mage_Catalog_Model_Product_Attribute_Media_Api __construct ()
create (line 115)

Create new image for product and return image filename

  • access: public
string create (int|string $productId, array $data, [string|int $store = null], [ $identifierType = null])
  • int|string $productId
  • array $data
  • string|int $store
  • $identifierType
info (line 94)

Retrieve image data

  • access: public
array info (int|string $productId, string $file, [string|int $store = null], [ $identifierType = null])
  • int|string $productId
  • string $file
  • string|int $store
  • $identifierType
items (line 65)

Retrieve images for product

  • access: public
array items (int|string $productId, [string|int $store = null], [ $identifierType = null])
  • int|string $productId
  • string|int $store
  • $identifierType
remove (line 262)

Remove image from product

  • access: public
boolean remove (int|string $productId, string $file, [ $identifierType = null])
  • int|string $productId
  • string $file
  • $identifierType
types (line 290)

Retrieve image types (image, small_image, thumbnail, etc...)

  • access: public
array types (int $setId)
  • int $setId
update (line 192)

Update image data

  • access: public
boolean update (int|string $productId, string $file, array $data, [string|int $store = null], [ $identifierType = null])
  • int|string $productId
  • string $file
  • array $data
  • string|int $store
  • $identifierType
_getGalleryAttribute (line 337)

Retrieve gallery attribute from product

  • access: protected
void _getGalleryAttribute (Mage_Catalog_Model_Product $product, Mage_Catalog_Model_Resource_Eav_Mysql4_Attribute|boolean 1)
_getMediaConfig (line 355)

Retrie ve media config

  • access: protected
_imageToArray (line 367)

Converts image to api array data

  • access: protected
array _imageToArray ( &$image, Mage_Catalog_Model_Product $product, array $image)
_initProduct (line 395)

Retrieve product

  • access: protected
Mage_Catalog_Model_Product _initProduct (int|string $productId, [string|int $store = null], [ $identifierType = null])
  • int|string $productId
  • string|int $store
  • $identifierType
_prepareImageData (line 326)

Prepare data to create or update image

  • access: protected
array _prepareImageData (array $data)
  • array $data

Redefined in descendants as:

Inherited Methods

Inherited From Mage_Catalog_Model_Api_Resource

Mage_Catalog_Model_Api_Resource::currentStore()
Mage_Catalog_Model_Api_Resource::_getProduct()
Mage_Catalog_Model_Api_Resource::_getStoreId()
Mage_Catalog_Model_Api_Resource::_isAllowedAttribute()

Inherited From Mage_Api_Model_Resource_Abstract

Mage_Api_Model_Resource_Abstract::getResourceConfig()
Mage_Api_Model_Resource_Abstract::setResourceConfig()
Mage_Api_Model_Resource_Abstract::_fault()
Mage_Api_Model_Resource_Abstract::_getConfig()
Mage_Api_Model_Resource_Abstract::_getServer()
Mage_Api_Model_Resource_Abstract::_getSession()
Class Constants
ATTRIBUTE_CODE = 'media_gallery' (line 40)

Attribute code for media gallery

Documentation generated on Fri, 11 Feb 2011 16:56:33 +0200 by phpDocumentor 1.4.3