本文整理汇总了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');
}