Class Mage_Catalog_Model_Product

Description

Catalog product model

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

Varien_Object
   |
   --Mage_Core_Model_Abstract
      |
      --Mage_Catalog_Model_Abstract
         |
         --Mage_Catalog_Model_Product
Class Constant Summary
 CACHE_TAG = 'catalog_product'
Variable Summary
Method Summary
void addAttributeUpdate ( $code,  $value,  $store)
Mage_Catalog_Model_Product addCustomOption (string $code, mixed $value, [ $product = null], int $productId)
void addImageToMediaGallery (string $file, [string|array $mediaAttribute = null], [boolean $move = false], [boolean $exclude = true])
bool canAffectOptions ([bool $value = null])
bool canBeShowInCategory (int $categoryId)
void cleanCache ()
void delete ()
void formatUrlKey ( $str)
void fromArray ( $data)
array getAttributes ([int $groupId = null], [ $skipSuper = false])
void getAttributeText ( $attributeCode)
Varien_Data_Collection getCategoryCollection ()
int getCategoryId ()
void getCategoryIds ()
array getCustomOption (string $code)
array getCustomOptions ()
double getFinalPrice ([double $qty = null])
array getFormatedPrice ()
array getFormatedTierPrice ([double $qty = null])
integer getIdBySku (string $sku)
void getImageUrl ()
bool getIsVirtual ()
Varien_Data_Collection getMediaGalleryImages ()
void getMinimalPrice ()
void getName ()
array getOptions ()
unknown getPrice ()
void getPriceModel ()
string getProductUrl ([bool $useSid = true])
void getRequestPath ()
array getReservedAttributes (none 0)
string getSku ()
void getSmallImageUrl ([ $width = 88], [ $height = 77])
void getSpecialPrice ()
void getStatus ()
void getStoreIds ()
void getThumbnailUrl ([ $width = 75], [ $height = 75])
double getTierPrice ([double $qty = null])
void getTypeId ()
string getUrlPath ([Mage_Catalog_Model_Category $category = null])
array getWebsiteIds ()
unknown getWeight ()
bool isComposite ()
bool isConfigurable ()
bool isGrouped ()
void isInStock ()
bool isSalable ()
void isSaleable ()
void isSuper ()
void isSuperConfig ()
void isSuperGroup ()
void setCategoryIds ( $ids)
void setCustomOptions ( $options)
void setTypeInstance ( $instance)
void toArray ([ $arrAttributes = array()])
void validate ()
void _afterLoad ()
unknown _afterSave ()
void _beforeDelete ()
void _beforeSave ()
void _construct ()
Variables
static mixed $_url (line 70)
  • access: protected
static mixed $_urlRewrite (line 71)
  • access: protected
mixed $_cacheTag = 'catalog_product' (line 37)
  • access: protected

Redefinition of:
Mage_Core_Model_Abstract::$_cacheTag
Model cache tag for clear cache in after save and after delete
mixed $_canAffectOptions = false (line 40)
  • access: protected
array $_customOptions = array() (line 61)

Product object customization (not stored in DB)

  • access: protected
mixed $_errors = array() (line 73)
  • access: protected
mixed $_eventObject = 'product' (line 39)
  • access: protected

Redefinition of:
Mage_Core_Model_Abstract::$_eventObject
Parameter name in event
mixed $_eventPrefix = 'catalog_product' (line 38)
  • access: protected

Redefinition of:
Mage_Core_Model_Abstract::$_eventPrefix
Prefix of model events names
Mage_Catalog_Model_Product_Link $_linkInstance (line 54)

Product link instance

  • access: protected
mixed $_optionInstance (line 75)
  • access: protected
mixed $_options = array() (line 77)
  • access: protected
mixed $_reservedAttributes (line 82)

Product reserved attribute codes

  • access: protected
Mage_Catalog_Model_Product_Type_Abstract $_typeInstance = null (line 47)

Product type instance

  • access: protected
Mage_Catalog_Model_Product_Url $_urlModel = null (line 68)

Product Url Instance

  • access: protected

Inherited Variables

Inherited from Mage_Catalog_Model_Abstract

Mage_Catalog_Model_Abstract::$_defaultValues

Inherited from Mage_Core_Model_Abstract

Mage_Core_Model_Abstract::$_dataSaveAllowed
Mage_Core_Model_Abstract::$_resource
Mage_Core_Model_Abstract::$_resourceCollectionName
Mage_Core_Model_Abstract::$_resourceName
Methods
addAttributeUpdate (line 1022)
  • access: public
void addAttributeUpdate ( $code,  $value,  $store)
  • $code
  • $value
  • $store
addCustomOption (line 1200)

Add custom option information to product

  • access: public
Mage_Catalog_Model_Product addCustomOption (string $code, mixed $value, [ $product = null], int $productId)
  • string $code
  • mixed $value
  • int $productId
  • $product
addImageToMediaGallery (line 759)

Add image to media gallery

  • access: public
void addImageToMediaGallery (string $file, [string|array $mediaAttribute = null], [boolean $move = false], [boolean $exclude = true])
  • 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
addOption (line 1151)

Add option to array of product options

  • access: public
canAffectOptions (line 354)

Check/set if options can be affected when saving product If value specified, it will be set.

  • access: public
bool canAffectOptions ([bool $value = null])
  • bool $value
canBeShowInCategory (line 1261)

Check availability display product in category

  • access: public
bool canBeShowInCategory (int $categoryId)
  • int $categoryId
cleanCache (line 415)
  • access: public
void cleanCache ()
delete (line 1063)
  • access: public
void delete ()

Redefinition of:
Mage_Core_Model_Abstract::delete()
Delete object from database
duplicate (line 786)

Create duplicate

  • access: public
formatUrlKey (line 1006)
  • access: public
void formatUrlKey ( $str)
  • $str
fromArray (line 1045)
  • access: public
void fromArray ( $data)
  • $data
getAttributes (line 275)

Retrieve product attributes

if $groupId is null - retrieve all product attributes

  • access: public
array getAttributes ([int $groupId = null], [ $skipSuper = false])
  • int $groupId
  • $skipSuper
getAttributeText (line 978)
  • access: public
void getAttributeText ( $attributeCode)
  • $attributeCode
getAvailableInCategories (line 1267)
  • access: public
void getAvailableInCategories ()
getCalculatedFinalPrice (line 478)
  • access: public
void getCalculatedFinalPrice ()
getCategory (line 187)

Retrieve product category

  • access: public
getCategoryCollection (line 233)

Retrieve product categories

  • access: public
Varien_Data_Collection getCategoryCollection ()
getCategoryId (line 174)

Retrieve product category id

  • access: public
int getCategoryId ()
getCategoryIds (line 213)
  • access: public
void getCategoryIds ()
getCrossSellLinkCollection (line 679)

Retrieve collection cross sell link

  • access: public
void getCrossSellLinkCollection ()
getCrossSellProductCollection (line 667)

Retrieve collection cross sell product

  • access: public
getCrossSellProductIds (line 650)

Retrieve cross sell products identifiers

  • access: public
array getCrossSellProductIds ()
getCrossSellProducts (line 633)

Retrieve array of cross sell products

  • access: public
array getCrossSellProducts ()
getCustomDesignDate (line 986)
  • access: public
void getCustomDesignDate ()
getCustomOption (line 1233)

Get product custom option info

  • access: public
array getCustomOption (string $code)
  • string $code
getCustomOptions (line 1222)

Get all custom options of the product

  • access: public
array getCustomOptions ()
getDefaultAttributeSetId (line 1291)

Retrieve default attribute set id

  • access: public
int getDefaultAttributeSetId ()
getFinalPrice (line 473)

Get product final price

  • access: public
double getFinalPrice ([double $qty = null])
  • double $qty
getFormatedPrice (line 462)

Get formated by currency product price

  • return: || double
  • access: public
array getFormatedPrice ()
getFormatedTierPrice (line 452)

Get formated by currency tier price

  • return: || double
  • access: public
array getFormatedTierPrice ([double $qty = null])
  • double $qty
getGiftMessageAvailable (line 1079)

Custom function for other modules

  • access: public
void getGiftMessageAvailable ()
getGroupedLinkCollection (line 693)

Retrieve collection grouped link

  • access: public
void getGroupedLinkCollection ()
getIdBySku (line 164)

Retrive product id by sku

  • access: public
integer getIdBySku (string $sku)
  • string $sku
getImageUrl (line 1300)

Deprecated since 1.1.5

  • access: public
void getImageUrl ()
getIsVirtual (line 1187)

Retrieve is a virtual product

  • access: public
bool getIsVirtual ()
getLinkInstance (line 150)

Retrieve type instance

  • access: public
Mage_Catalog_Model_Product_Link getLinkInstance ()
getMediaAttributes (line 712)

Retrive attributes for media gallery

  • access: public
array getMediaAttributes ()
getMediaConfig (line 776)

Retrive product media config

  • access: public
getMediaGalleryImages (line 731)

Retrive media gallery images

  • access: public
Varien_Data_Collection getMediaGalleryImages ()
getMinimalPrice (line 483)
  • access: public
void getMinimalPrice ()
getName (line 99)
  • access: public
void getName ()
getOptionById (line 1163)

Get option from options array of product by given option id

  • return: | null
  • access: public
Mage_Catalog_Model_Product_Option getOptionById (int $optionId)
  • int $optionId
getOptionInstance (line 1124)

Retrieve option instance

  • access: public
Mage_Catalog_Model_Product_Option getOptionInstance ()
getOptions (line 1177)

Get all options of product

  • access: public
array getOptions ()
getPrice (line 109)

Get product price throught type instance

  • access: public
unknown getPrice ()
getPriceModel (line 420)
  • access: public
void getPriceModel ()
getProductOptionsCollection (line 1137)

Retrieve options collection of product

  • access: public
getProductUrl (line 1001)

Get product url

  • access: public
string getProductUrl ([bool $useSid = true])
  • bool $useSid
getRatingSummary (line 1084)
  • access: public
void getRatingSummary ()
getRelatedLinkCollection (line 557)

Retrieve collection related link

  • access: public
void getRelatedLinkCollection ()
getRelatedProductCollection (line 545)

Retrieve collection related product

  • access: public
void getRelatedProductCollection ()
getRelatedProductIds (line 530)

Retrieve related products identifiers

  • access: public
array getRelatedProductIds ()
getRelatedProducts (line 512)

Retrieve array of related roducts

  • access: public
array getRelatedProducts ()
getRequestPath (line 1070)
  • access: public
void getRequestPath ()
getReservedAttributes (line 1327)

Returns system reserved attribute codes

  • return: Reserved attribute names
  • access: public
array getReservedAttributes (none 0)
  • none 0
getSku (line 1104)

Retrieve sku through type instance

  • access: public
string getSku ()
getSmallImageUrl (line 1308)

Deprecated since 1.1.5

  • access: public
void getSmallImageUrl ([ $width = 88], [ $height = 77])
  • $width
  • $height
getSpecialFromDate (line 493)
  • access: public
void getSpecialFromDate ()
getSpecialPrice (line 488)
  • access: public
void getSpecialPrice ()
getSpecialToDate (line 498)
  • access: public
void getSpecialToDate ()
getStatus (line 119)
  • access: public
void getStatus ()
getStoreIds (line 252)
  • access: public
void getStoreIds ()
getThumbnailUrl (line 1316)

Deprecated since 1.1.5

  • access: public
void getThumbnailUrl ([ $width = 75], [ $height = 75])
  • $width
  • $height
getTierPrice (line 431)

Get product tier price by qty

  • access: public
double getTierPrice ([double $qty = null])
  • double $qty
getTierPriceCount (line 441)

Count how many tier prices we have for the product

  • access: public
int getTierPriceCount ()
getTypeId (line 114)
  • access: public
void getTypeId ()
getTypeInstance (line 131)

Retrieve type instance

Type instance implement type depended logic

  • access: public
getUpSellLinkCollection (line 617)

Retrieve collection up sell link

  • access: public
void getUpSellLinkCollection ()
getUpSellProductCollection (line 605)

Retrieve collection up sell product

  • access: public
void getUpSellProductCollection ()
getUpSellProductIds (line 590)

Retrieve up sell products identifiers

  • access: public
array getUpSellProductIds ()
getUpSellProducts (line 573)

Retrieve array of up sell products

  • access: public
array getUpSellProducts ()
getUrlPath (line 1017)

Retrieve Product Url Path (include category)

  • access: public
string getUrlPath ([Mage_Catalog_Model_Category $category = null])
getVisibleInCatalogStatuses (line 924)
  • access: public
void getVisibleInCatalogStatuses ()
getVisibleInSiteVisibilities (line 934)
  • access: public
void getVisibleInSiteVisibilities ()
getWebsiteIds (line 243)

Retrieve product websites identifiers

  • access: public
array getWebsiteIds ()
getWeight (line 1114)

Retrieve weight throught type instance

  • access: public
unknown getWeight ()
hasCustomOptions (line 1246)

Checks if there custom option for this product

  • access: public
bool hasCustomOptions ()
isComposite (line 1094)

Check is product composite

  • access: public
bool isComposite ()
isConfigurable (line 914)

Check is product configurable

  • access: public
bool isConfigurable ()
isGrouped (line 904)

Check is product grouped

  • access: public
bool isGrouped ()
isInStock (line 973)
  • access: public
void isInStock ()
isReservedAttribute (line 1353)

Check whether attribute reserved or not

  • access: public
boolean isReservedAttribute (Mage_Eav_Model_Entity_Attribute $attribute)
isSalable (line 949)

Check is product available for sale

  • access: public
bool isSalable ()
isSaleable (line 968)
  • access: public
void isSaleable ()
isSuper (line 919)
  • access: public
void isSuper ()
isSuperConfig (line 895)
  • access: public
void isSuperConfig ()
isSuperGroup (line 890)
  • access: public
void isSuperGroup ()
isVisibleInCatalog (line 929)
  • access: public
void isVisibleInCatalog ()
isVisibleInSiteVisibility (line 939)
  • access: public
void isVisibleInSiteVisibility ()
loadParentProductIds (line 1058)
  • access: public
void loadParentProductIds ()
setCategoryIds (line 197)
  • access: public
void setCategoryIds ( $ids)
  • $ids
setCustomOptions (line 1212)
  • access: public
void setCustomOptions ( $options)
  • array $options
setTypeInstance (line 139)
  • access: public
void setTypeInstance ( $instance)
  • $instance
toArray (line 1035)
  • access: public
void toArray ([ $arrAttributes = array()])
  • array $arrAttributes
validate (line 93)
  • access: public
void validate ()
_afterLoad (line 404)
  • access: protected
void _afterLoad ()

Redefinition of:
Mage_Core_Model_Abstract::_afterLoad()
Processing object after load data
_afterSave (line 367)

Saving product type related data

  • access: protected
unknown _afterSave ()

Redefinition of:
Mage_Core_Model_Abstract::_afterSave()
Processing object after save data
_beforeDelete (line 388)
  • access: protected
void _beforeDelete ()

Redefinition of:
Mage_Core_Model_Abstract::_beforeDelete()
Processing object before delete data
_beforeSave (line 297)

Check product options and type options and save them, too

  • access: protected
void _beforeSave ()

Redefinition of:
Mage_Core_Model_Abstract::_beforeSave()
Processing object before save data
_construct (line 87)

Initialize resources

  • access: protected
void _construct ()
_substractQtyFromQuotes (line 399)

deprecated

void _substractQtyFromQuotes ()

Inherited Methods

Inherited From Mage_Catalog_Model_Abstract

Mage_Catalog_Model_Abstract::getAttributeDefaultValue()
Mage_Catalog_Model_Abstract::getResourceCollection()
Mage_Catalog_Model_Abstract::getStore()
Mage_Catalog_Model_Abstract::getWebsiteStoreIds()
Mage_Catalog_Model_Abstract::loadByAttribute()
Mage_Catalog_Model_Abstract::setAttributeDefaultValue()

Inherited From Mage_Core_Model_Abstract

Mage_Core_Model_Abstract::afterLoad()
Mage_Core_Model_Abstract::delete()
Mage_Core_Model_Abstract::getCollection()
Mage_Core_Model_Abstract::getEntityId()
Mage_Core_Model_Abstract::getId()
Mage_Core_Model_Abstract::getIdFieldName()
Mage_Core_Model_Abstract::getResource()
Mage_Core_Model_Abstract::getResourceCollection()
Mage_Core_Model_Abstract::getResourceName()
Mage_Core_Model_Abstract::load()
Mage_Core_Model_Abstract::save()
Mage_Core_Model_Abstract::setId()
Mage_Core_Model_Abstract::_afterDelete()
Mage_Core_Model_Abstract::_afterLoad()
Mage_Core_Model_Abstract::_afterSave()
Mage_Core_Model_Abstract::_beforeDelete()
Mage_Core_Model_Abstract::_beforeSave()
Mage_Core_Model_Abstract::_getResource()
Mage_Core_Model_Abstract::_init()
Mage_Core_Model_Abstract::_protectFromNonAdmin()
Mage_Core_Model_Abstract::_setResourceModel()
Class Constants
CACHE_TAG = 'catalog_product' (line 36)

Inherited Constants

Inherited from Mage_Catalog_Model_Abstract

Mage_Catalog_Model_Abstract::DEFAULT_STORE_ID

Documentation generated on Wed, 04 Feb 2009 03:30:16 +0200 by phpDocumentor 1.4.2