Mage_CatalogInventory_Helper_Data Class Reference

Inheritance diagram for Mage_CatalogInventory_Helper_Data:

Mage_Core_Helper_Abstract

List of all members.

Public Member Functions

 isQty ($productTypeId)
 getIsQtyTypeIds ($filter=null)
 getConfigItemOptions ()

Static Protected Attributes

static $_isQtyTypeIds


Detailed Description

Catalo

Definition at line 30 of file Data.php.


Member Function Documentation

getConfigItemOptions (  ) 

Retrieve inventory item options (used in config)

Returns:
array

Definition at line 86 of file Data.php.

00087     {
00088         return array(
00089             'min_qty',
00090             'backorders',
00091             'min_sale_qty',
00092             'max_sale_qty',
00093             'notify_stock_qty',
00094             'manage_stock'
00095         );
00096     }

getIsQtyTypeIds ( filter = null  ) 

Get all registered product type ids and if quantity is defined for them

Parameters:
bool $filter
Returns:
array

Definition at line 60 of file Data.php.

00061     {
00062         if (null === self::$_isQtyTypeIds) {
00063             self::$_isQtyTypeIds = array();
00064             $productTypesXml = Mage::getConfig()->getNode('global/catalog/product/type');
00065             foreach ($productTypesXml->children() as $typeId => $configXml) {
00066                 self::$_isQtyTypeIds[$typeId] = (bool)$configXml->is_qty;
00067             }
00068         }
00069         if (null === $filter) {
00070             return self::$_isQtyTypeIds;
00071         }
00072         $result = self::$_isQtyTypeIds;
00073         foreach ($result as $key => $value) {
00074             if ($value !== $filter) {
00075                 unset($result[$key]);
00076             }
00077         }
00078         return $result;
00079     }

isQty ( productTypeId  ) 

Check if quantity defined for specified product type

Parameters:
string $productTypeId
Returns:
bool

Definition at line 45 of file Data.php.

00046     {
00047         $this->getIsQtyTypeIds();
00048         if (!isset(self::$_isQtyTypeIds[$productTypeId])) {
00049             return false;
00050         }
00051         return self::$_isQtyTypeIds[$productTypeId];
00052     }


Member Data Documentation

$_isQtyTypeIds [static, protected]

Definition at line 37 of file Data.php.


The documentation for this class was generated from the following file:

Generated on Sat Jul 4 17:23:47 2009 for Magento by  doxygen 1.5.8