Public Member Functions | |
getTags () | |
getMaxPopularity () | |
getMinPopularity () | |
Protected Member Functions | |
_loadTags () | |
_getHeadText () | |
Protected Attributes | |
$_tags | |
$_minPopularity | |
$_maxPopularity |
Definition at line 35 of file All.php.
_getHeadText | ( | ) | [protected] |
Definition at line 88 of file All.php.
00089 { 00090 return Mage::helper('tag')->__('All Tags'); 00091 }
_loadTags | ( | ) | [protected] |
Definition at line 42 of file All.php.
00043 { 00044 if (empty($this->_tags)) { 00045 $this->_tags = array(); 00046 $tags = Mage::getModel('tag/tag')->getPopularCollection() 00047 ->joinFields(Mage::app()->getStore()->getId()) 00048 ->limit(100) 00049 ->load() 00050 ->getItems(); 00051 00052 if( count($tags) == 0 ) { 00053 return $this; 00054 } 00055 00056 $this->_maxPopularity = reset($tags)->getPopularity(); 00057 $this->_minPopularity = end($tags)->getPopularity(); 00058 $range = $this->_maxPopularity - $this->_minPopularity; 00059 $range = ( $range == 0 ) ? 1 : $range; 00060 foreach ($tags as $tag) { 00061 if( !$tag->getPopularity() ) { 00062 continue; 00063 } 00064 $tag->setRatio(($tag->getPopularity()-$this->_minPopularity)/$range); 00065 $this->_tags[$tag->getName()] = $tag; 00066 } 00067 ksort($this->_tags); 00068 } 00069 return $this; 00070 }
getMaxPopularity | ( | ) |
getMinPopularity | ( | ) |
getTags | ( | ) |