本文整理汇总了PHP中Varien_Object_Cache类的典型用法代码示例。如果您正苦于以下问题:PHP Varien_Object_Cache类的具体用法?PHP Varien_Object_Cache怎么用?PHP Varien_Object_Cache使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Varien_Object_Cache类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getBatchImportModel
/**
* Retrieve Batch import model
*
* @return Mage_Dataflow_Model_Import_Export
*/
public function getBatchImportModel()
{
if (is_null($this->_batchImport)) {
$object = Mage::getModel('dataflow/batch_import');
$this->_batchImport = Varien_Object_Cache::singleton()->save($object);
}
return Varien_Object_Cache::singleton()->load($this->_batchImport);
}
示例2: objects
/**
* Varien Objects Cache
*
* @param string $key optional, if specified will load this key
* @return Varien_Object_Cache
*/
public static function objects($key = null)
{
if (!self::$_objects) {
self::$_objects = new Varien_Object_Cache();
}
if (is_null($key)) {
return self::$_objects;
} else {
return self::$_objects->load($key);
}
}
示例3: singleton
/**
* Singleton factory
*
* @return Varien_Object_Cache
*/
public static function singleton()
{
if (!self::$_instance) {
self::$_instance = new self();
}
return self::$_instance;
}
示例4: getConfigModel
public function getConfigModel()
{
if (is_null($this->_configModel)) {
$object = Mage::getModel('core/config_data');
$this->_configModel = Varien_Object_Cache::singleton()->save($object);
}
return Varien_Object_Cache::singleton()->load($this->_configModel);
}
示例5: getBatchImportModel
/**
* Retrieve Batch import model
*
* @return Mage_Dataflow_Model_Import_Export
*/
public function getBatchImportModel()
{
if (is_null($this->_batchImport)) {
$object = Mage::getModel('Mage_Dataflow_Model_Batch_Import');
$object->setBatchId($this->getId());
$this->_batchImport = Varien_Object_Cache::singleton()->save($object);
}
return Varien_Object_Cache::singleton()->load($this->_batchImport);
}