本文整理匯總了PHP中Registry::registry方法的典型用法代碼示例。如果您正苦於以下問題:PHP Registry::registry方法的具體用法?PHP Registry::registry怎麽用?PHP Registry::registry使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Registry
的用法示例。
在下文中一共展示了Registry::registry方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getBrand
public function getBrand()
{
$product = $this->registry->registry('current_product');
$collection = $this->_brandFactory->create()->getCollection();
$collection->addFieldToFilter('attribute_id', $product->getManufacturer());
return $collection->getFirstItem();
}
示例2: getInstance
public static function getInstance()
{
if (self::$registry === null) {
self::$registry = new self();
}
return self::$registry;
}
示例3: clear
public static function clear()
{
self::$registry = array();
}
示例4: close
/**
* Closes and clean-up the registry database
*/
public static function close()
{
return self::$registry = array();
}
示例5: getInstanceRegistry
/**
* The singleton method.
*
* This method implements the pattern singleton.
*
* @return object Return the object instanced.
*
* @throws None.
*
* @access private
* @static No.
* @see None.
* @since Available from the version 1.0 20-09-2007.
* @deprecated No.
*/
public static function getInstanceRegistry()
{
if (!isset(self::$registry)) {
$class = __CLASS__;
self::$registry = new $class();
}
return self::$registry;
}
示例6: deleteAll
/**
* deletes the whole registry
*
* @static
* @access public
* @return void
*/
public static function deleteAll()
{
self::$registry = array();
}
示例7: setAll
/**
* Overwrite all entries with the provided array
* of keys => objects
*
* @param $registry array
*/
public static function setAll($registry)
{
self::$registry = $registry;
}
示例8: getCurrentCategory
public function getCurrentCategory()
{
return $this->registry->registry('current_category');
}