Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Inventory Class Reference

Inheritance diagram for Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Inventory:

Mage_Adminhtml_Block_Widget Mage_Adminhtml_Block_Template Mage_Core_Block_Template Mage_Core_Block_Abstract Varien_Object

List of all members.

Public Member Functions

 __construct ()
 getBackordersOption ()
 getStockOption ()
 getProduct ()
 getStockItem ()
 isConfigurable ()
 getFieldValue ($field)
 getConfigFieldValue ($field)
 getDefaultConfigValue ($field)
 isReadonly ()
 isNew ()
 getFieldSuffix ()


Detailed Description

Product inventory data

Author:
Magento Core Team <core@magentocommerce.com>

Definition at line 32 of file Inventory.php.


Constructor & Destructor Documentation

__construct (  ) 

Constructor

By default is looking for first argument as array and assignes it as object attributes This behaviour may change in child classes

Reimplemented from Varien_Object.

Definition at line 34 of file Inventory.php.

00035     {
00036         parent::__construct();
00037         $this->setTemplate('catalog/product/tab/inventory.phtml');
00038     }


Member Function Documentation

getBackordersOption (  ) 

Definition at line 40 of file Inventory.php.

00041     {
00042         return Mage::getSingleton('cataloginventory/source_backorders')->toOptionArray();
00043     }

getConfigFieldValue ( field  ) 

Definition at line 84 of file Inventory.php.

00085     {
00086         if ($this->getStockItem()) {
00087             if ($this->getStockItem()->getData('use_config_' . $field) == 0) {
00088                 return $this->getStockItem()->getData($field);
00089             }
00090         }
00091 
00092         return Mage::getStoreConfig(Mage_CatalogInventory_Model_Stock_Item::XML_PATH_ITEM . $field);
00093     }

getDefaultConfigValue ( field  ) 

Definition at line 95 of file Inventory.php.

getFieldSuffix (  ) 

Definition at line 118 of file Inventory.php.

00119     {
00120         return 'product';
00121     }

getFieldValue ( field  ) 

Definition at line 75 of file Inventory.php.

00076     {
00077         if ($this->getStockItem()) {
00078             return $this->getStockItem()->getDataUsingMethod($field);
00079         }
00080 
00081         return Mage::getStoreConfig(Mage_CatalogInventory_Model_Stock_Item::XML_PATH_ITEM . $field);
00082     }

getProduct (  ) 

Definition at line 55 of file Inventory.php.

00056     {
00057         return Mage::registry('product');
00058     }

getStockItem (  ) 

Retrieve Catalog Inventory Stock Item Model

Returns:
Mage_CatalogInventory_Model_Stock_Item

Definition at line 65 of file Inventory.php.

00066     {
00067         return Mage::registry('product')->getStockItem();
00068     }

getStockOption (  ) 

Retrieve stock option array

Returns:
array

Definition at line 50 of file Inventory.php.

00051     {
00052         return Mage::getSingleton('cataloginventory/source_stock')->toOptionArray();
00053     }

isConfigurable (  ) 

Definition at line 70 of file Inventory.php.

00071     {
00072         return Mage::registry('product')->isConfigurable();
00073     }

isNew (  ) 

Definition at line 110 of file Inventory.php.

00111     {
00112         if (Mage::registry('product')->getId()) {
00113             return false;
00114         }
00115         return true;
00116     }

isReadonly (  ) 

Is readonly stock

Returns:
boolean

Definition at line 105 of file Inventory.php.

00106     {
00107         return $this->getProduct()->getInventoryReadonly();
00108     }


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

Generated on Sat Jul 4 17:22:45 2009 for Magento by  doxygen 1.5.8