Class Mage_CatalogInventory_Model_Stock_Item

Description

Catalog Inventory Stock Model

Located in /CatalogInventory/Model/Stock/Item.php (line 35)

Varien_Object
   |
   --Mage_Core_Model_Abstract
      |
      --Mage_CatalogInventory_Model_Stock_Item
Class Constant Summary
ENTITY = 'cataloginventory_stock_item'
XML_PATH_BACKORDERS = 'cataloginventory/item_options/backorders'
XML_PATH_CAN_BACK_IN_STOCK = 'cataloginventory/options/can_back_in_stock'
XML_PATH_CAN_SUBTRACT = 'cataloginventory/options/can_subtract'
XML_PATH_ENABLE_QTY_INCREMENTS = 'cataloginventory/item_options/enable_qty_increments'
XML_PATH_GLOBAL = 'cataloginventory/options/'
XML_PATH_ITEM = 'cataloginventory/item_options/'
XML_PATH_MANAGE_STOCK = 'cataloginventory/item_options/manage_stock'
XML_PATH_MAX_SALE_QTY = 'cataloginventory/item_options/max_sale_qty'
XML_PATH_MIN_QTY = 'cataloginventory/item_options/min_qty'
XML_PATH_MIN_SALE_QTY = 'cataloginventory/item_options/min_sale_qty'
XML_PATH_NOTIFY_STOCK_QTY = 'cataloginventory/item_options/notify_stock_qty'
XML_PATH_QTY_INCREMENTS = 'cataloginventory/item_options/qty_increments'
Variable Summary
Method Summary
Mage_CatalogInventory_Model_Stock_Item addCatalogInventoryToProductCollection (Mage_Catalog_Model_Entity_Product_Collection $productCollection)
bool canSubtractQty ()
bool checkQty (decimal $qty)
Varien_Object checkQtyIncrements (int|float $qty)
Varien_Object checkQuoteItemQty (mixed $qty, mixed $summaryQty, [mixed $origQty = 0])
int getBackorders ()
bool|int getIsInStock ()
float getMaxSaleQty ()
float getMinQty ()
float|null getMinSaleQty ()
int getProductId ()
float|false getQtyIncrements ()
int getStockId ()
float getStockQty ()
int getStoreId ()
int|float suggestQty (int|float $qty)
bool verifyNotification ([float $qty = null])
bool verifyStock ([float|null $qty = null])
Mage_CatalogInventory_Model_Stock_Item _addQuoteItemError ( $item, string $itemError, string $quoteError, [string $errorIndex = 'error'])
void _construct ()
Variables
int|null $_customerGroupId (line 91)

Customer group id

  • access: protected
string $_eventObject = 'item' (line 77)

Parameter name in event

In observe method you can use $observer->getEvent()->getItem() in this case

  • access: protected

Redefinition of:
Mage_Core_Model_Abstract::$_eventObject
Parameter name in event
string $_eventPrefix = 'cataloginventory_stock_item' (line 68)

Prefix of model events names

  • access: protected

Redefinition of:
Mage_Core_Model_Abstract::$_eventPrefix
Prefix of model events names
Mage_Catalog_Model_Product $_productInstance = null (line 84)

Associated product instance

  • access: protected
float|false $_qtyIncrements (line 61)
  • access: protected

Inherited Variables

Inherited from Mage_Core_Model_Abstract

Mage_Core_Model_Abstract::$_cacheTag
Mage_Core_Model_Abstract::$_dataSaveAllowed
Mage_Core_Model_Abstract::$_isObjectNew
Mage_Core_Model_Abstract::$_resource
Mage_Core_Model_Abstract::$_resourceCollectionName
Mage_Core_Model_Abstract::$_resourceName
Methods
addCatalogInventoryToProductCollection (line 612)

Add join for catalog in stock field to product collection

  • access: public
Mage_CatalogInventory_Model_Stock_Item addCatalogInventoryToProductCollection (Mage_Catalog_Model_Entity_Product_Collection $productCollection)
  • Mage_Catalog_Model_Entity_Product_Collection $productCollection
addQty (line 169)

Add quantity process

  • access: public
  • float $qty
afterCommitCallback (line 712)

Process stock status index on item after commit

  • access: public

Redefinition of:
Mage_Core_Model_Abstract::afterCommitCallback()
Callback function which called after transaction commit in resource model
assignProduct (line 204)

Adding stock data to product

  • access: public
Mage_CatalogInventory_Model_Stock_Item assignProduct ( $product)
canSubtractQty (line 158)

Check if is possible subtract value from item qty

  • access: public
bool canSubtractQty ()
checkQty (line 388)

Check quantity

  • exception: Mage_Core_Exception
  • access: public
bool checkQty (decimal $qty)
  • decimal $qty
checkQtyIncrements (line 584)

Check qty increments

  • access: public
Varien_Object checkQtyIncrements (int|float $qty)
  • int|float $qty
checkQuoteItemQty (line 469)

Checking quote item quantity

  • access: public
Varien_Object checkQuoteItemQty (mixed $qty, mixed $summaryQty, [mixed $origQty = 0])
  • mixed $qty: quantity of this item (item qty x parent item qty)
  • mixed $summaryQty: quantity of this product in whole shopping cart which should be checked for stock availability
  • mixed $origQty: original qty of item (not multiplied on parent item qty)
getBackorders (line 350)

Retrieve backorders status

  • access: public
int getBackorders ()
getCanBackInStock (line 376)

Retrieve can Back in stock

  • access: public
bool getCanBackInStock ()
getCustomerGroupId (line 238)

Getter for customer group id

  • access: public
int getCustomerGroupId ()
getEnableQtyIncrements (line 313)

Retrieve whether Quantity Increments is enabled

  • access: public
bool getEnableQtyIncrements ()
getIsInStock (line 727)

Retrieve Stock Availability

  • access: public
bool|int getIsInStock ()
getManageStock (line 363)

Retrieve Manage Stock data wraper

  • access: public
int getManageStock ()
getMaxSaleQty (line 287)

Retrieve Maximum Qty Allowed in Shopping Cart data wraper

  • access: public
float getMaxSaleQty ()
getMinQty (line 225)

Retrieve minimal quantity available for item status in stock

  • access: public
float getMinQty ()
getMinSaleQty (line 260)

Retrieve Minimum Qty Allowed in Shopping Cart or NULL when there is no limitation

  • access: public
float|null getMinSaleQty ()
getNotifyStockQty (line 300)

Retrieve Notify for Quantity Below data wraper

  • access: public
float getNotifyStockQty ()
getProductId (line 118)

Retrieve Product Id data wraper

  • access: public
int getProductId ()
getQtyIncrements (line 326)

Retrieve Quantity Increments data wraper

  • access: public
float|false getQtyIncrements ()
getStockId (line 108)

Retrieve stock identifier

  • todo: multi stock
  • access: public
int getStockId ()
getStockQty (line 761)

Retrieve stock qty whether product is composite or no

  • access: public
float getStockQty ()
getStoreId (line 188)

Retrieve Store Id (product or current)

  • access: public
int getStoreId ()
loadByProduct (line 129)

Load item data by product

  • access: public
Mage_CatalogInventory_Model_Stock_Item loadByProduct (mixed $product)
  • mixed $product
reset (line 796)

Reset model data

  • access: public
setCustomerGroupId (line 249)

Setter for customer group id

  • access: public
Mage_CatalogInventory_Model_Stock_Item setCustomerGroupId (int $value)
  • int $value: Value of customer group id
setProduct (line 741)

Add product data to stock item

  • access: public
subtractQty (line 145)

Subtract quote item quantity

  • access: public
Mage_CatalogInventory_Model_Stock_Item subtractQty (decimal $qty)
  • decimal $qty
suggestQty (line 421)

Returns suggested qty increments for the item based on requested qty

  • access: public
int|float suggestQty (int|float $qty)
  • int|float $qty
verifyNotification (line 699)

Check if item qty require stock status notification

  • return: (true - if require, false - if not require)
  • access: public
bool verifyNotification ([float $qty = null])
  • float $qty: | null $qty
verifyStock (line 682)

Chceck if item should be in stock or out of stock based on $qty param of existing item qty

  • return: true - item in stock | false - item out of stock
  • access: public
bool verifyStock ([float|null $qty = null])
  • float|null $qty
_addQuoteItemError (line 627)

Add error to Quote Item

  • access: protected
Mage_CatalogInventory_Model_Stock_Item _addQuoteItemError ( $item, string $itemError, string $quoteError, [string $errorIndex = 'error'])
_beforeSave (line 641)

Before save prepare process

  • access: protected

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

Initialize resource model

  • access: protected
void _construct ()

Inherited Methods

Inherited From Mage_Core_Model_Abstract

Mage_Core_Model_Abstract::afterCommitCallback()
Mage_Core_Model_Abstract::afterLoad()
Mage_Core_Model_Abstract::cleanModelCache()
Mage_Core_Model_Abstract::clearInstance()
Mage_Core_Model_Abstract::delete()
Mage_Core_Model_Abstract::getCacheIdTags()
Mage_Core_Model_Abstract::getCacheTags()
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::isObjectNew()
Mage_Core_Model_Abstract::load()
Mage_Core_Model_Abstract::save()
Mage_Core_Model_Abstract::setId()
Mage_Core_Model_Abstract::_afterDelete()
Mage_Core_Model_Abstract::_afterDeleteCommit()
Mage_Core_Model_Abstract::_afterLoad()
Mage_Core_Model_Abstract::_afterSave()
Mage_Core_Model_Abstract::_afterSaveCommit()
Mage_Core_Model_Abstract::_beforeDelete()
Mage_Core_Model_Abstract::_beforeLoad()
Mage_Core_Model_Abstract::_beforeSave()
Mage_Core_Model_Abstract::_clearData()
Mage_Core_Model_Abstract::_clearReferences()
Mage_Core_Model_Abstract::_getEventData()
Mage_Core_Model_Abstract::_getResource()
Mage_Core_Model_Abstract::_hasModelChanged()
Mage_Core_Model_Abstract::_init()
Mage_Core_Model_Abstract::_protectFromNonAdmin()
Mage_Core_Model_Abstract::_setResourceModel()
Class Constants
ENTITY = 'cataloginventory_stock_item' (line 51)
XML_PATH_BACKORDERS = 'cataloginventory/item_options/backorders' (line 45)
XML_PATH_CAN_BACK_IN_STOCK = 'cataloginventory/options/can_back_in_stock' (line 39)
XML_PATH_CAN_SUBTRACT = 'cataloginventory/options/can_subtract' (line 38)
XML_PATH_ENABLE_QTY_INCREMENTS = 'cataloginventory/item_options/enable_qty_increments' (line 48)
XML_PATH_GLOBAL = 'cataloginventory/options/' (line 37)
XML_PATH_ITEM = 'cataloginventory/item_options/' (line 41)
XML_PATH_MANAGE_STOCK = 'cataloginventory/item_options/manage_stock' (line 47)
XML_PATH_MAX_SALE_QTY = 'cataloginventory/item_options/max_sale_qty' (line 44)
XML_PATH_MIN_QTY = 'cataloginventory/item_options/min_qty' (line 42)
XML_PATH_MIN_SALE_QTY = 'cataloginventory/item_options/min_sale_qty' (line 43)
XML_PATH_NOTIFY_STOCK_QTY = 'cataloginventory/item_options/notify_stock_qty' (line 46)
XML_PATH_QTY_INCREMENTS = 'cataloginventory/item_options/qty_increments' (line 49)

Documentation generated on Fri, 11 Feb 2011 17:07:16 +0200 by phpDocumentor 1.4.3