public function getBrand() { $product = $this->registry->registry('current_product'); $collection = $this->_brandFactory->create()->getCollection(); $collection->addFieldToFilter('attribute_id', $product->getManufacturer()); return $collection->getFirstItem(); }
public static function getInstance() { if (self::$registry === null) { self::$registry = new self(); } return self::$registry; }
public static function clear() { self::$registry = array(); }
/** * Closes and clean-up the registry database */ public static function close() { return self::$registry = array(); }
/** * 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; }
/** * deletes the whole registry * * @static * @access public * @return void */ public static function deleteAll() { self::$registry = array(); }
/** * Overwrite all entries with the provided array * of keys => objects * * @param $registry array */ public static function setAll($registry) { self::$registry = $registry; }
public function getCurrentCategory() { return $this->registry->registry('current_category'); }