Mage_Tag_Model_Tag Class Reference

Inheritance diagram for Mage_Tag_Model_Tag:

Mage_Core_Model_Abstract Varien_Object

List of all members.

Public Member Functions

 getPopularity ()
 getName ()
 getTagId ()
 getRatio ()
 setRatio ($ratio)
 loadByName ($name)
 aggregate ()
 productEventAggregate ($observer)
 addSummary ($storeId)
 getApprovedStatus ()
 getPendingStatus ()
 getEntityCollection ()
 getCustomerCollection ()
 getTaggedProductsUrl ()
 getViewTagUrl ()
 getEditTagUrl ()
 getRemoveTagUrl ()
 getPopularCollection ()

Public Attributes

const STATUS_DISABLED = -1
const STATUS_PENDING = 0
const STATUS_APPROVED = 1

Protected Member Functions

 _construct ()
 _beforeDelete ()


Detailed Description

Definition at line 35 of file Tag.php.


Member Function Documentation

_beforeDelete (  )  [protected]

Processing object before delete data

Returns:
Mage_Core_Model_Abstract

Reimplemented from Mage_Core_Model_Abstract.

Definition at line 152 of file Tag.php.

00153     {
00154         $this->_protectFromNonAdmin();
00155         return parent::_beforeDelete();
00156     }

_construct (  )  [protected]

Enter description here...

Reimplemented from Varien_Object.

Definition at line 41 of file Tag.php.

00042     {
00043         $this->_init('tag/tag');
00044     }

addSummary ( storeId  ) 

Definition at line 100 of file Tag.php.

00101     {
00102         $this->setStoreId($storeId);
00103         $this->_getResource()->addSummary($this);
00104         return $this;
00105     }

aggregate (  ) 

Definition at line 78 of file Tag.php.

00079     {
00080         $this->_getResource()->aggregate($this);
00081         return $this;
00082     }

getApprovedStatus (  ) 

Definition at line 107 of file Tag.php.

00108     {
00109         return self::STATUS_APPROVED;
00110     }

getCustomerCollection (  ) 

Definition at line 122 of file Tag.php.

00123     {
00124         return Mage::getResourceModel('tag/customer_collection');
00125     }

getEditTagUrl (  ) 

Definition at line 137 of file Tag.php.

00138     {
00139         return Mage::getUrl('tag/customer/edit', array('tagId' => $this->getTagId()));
00140     }

getEntityCollection (  ) 

Definition at line 117 of file Tag.php.

00118     {
00119         return Mage::getResourceModel('tag/product_collection');
00120     }

getName (  ) 

Definition at line 51 of file Tag.php.

00052     {
00053         return $this->_getData('name');
00054     }

getPendingStatus (  ) 

Definition at line 112 of file Tag.php.

00113     {
00114         return self::STATUS_PENDING;
00115     }

getPopularCollection (  ) 

Definition at line 147 of file Tag.php.

00148     {
00149         return Mage::getResourceModel('tag/popular_collection');
00150     }

getPopularity (  ) 

Definition at line 46 of file Tag.php.

00047     {
00048         return $this->_getData('popularity');
00049     }

getRatio (  ) 

Definition at line 61 of file Tag.php.

00062     {
00063         return $this->_getData('ratio');
00064     }

getRemoveTagUrl (  ) 

Definition at line 142 of file Tag.php.

00143     {
00144         return Mage::getUrl('tag/customer/remove', array('tagId' => $this->getTagId()));
00145     }

getTaggedProductsUrl (  ) 

Definition at line 127 of file Tag.php.

00128     {
00129         return Mage::getUrl('tag/product/list', array('tagId' => $this->getTagId()));
00130     }

getTagId (  ) 

Definition at line 56 of file Tag.php.

00057     {
00058         return $this->_getData('tag_id');
00059     }

getViewTagUrl (  ) 

Definition at line 132 of file Tag.php.

00133     {
00134         return Mage::getUrl('tag/customer/view', array('tagId' => $this->getTagId()));
00135     }

loadByName ( name  ) 

Definition at line 72 of file Tag.php.

00073     {
00074         $this->_getResource()->loadByName($this, $name);
00075         return $this;
00076     }

productEventAggregate ( observer  ) 

Definition at line 84 of file Tag.php.

00085     {
00086         $product = $observer->getEvent()->getProduct();
00087         $collection = $this->getResourceCollection()
00088             ->joinRel()
00089             ->addProductFilter($product->getId())
00090             ->addTagGroup()
00091             ->load();
00092 
00093 
00094         $collection->walk('aggregate');
00095 
00096 
00097         return $this;
00098     }

setRatio ( ratio  ) 

Definition at line 66 of file Tag.php.

00067     {
00068         $this->setData('ratio', $ratio);
00069         return $this;
00070     }


Member Data Documentation

const STATUS_APPROVED = 1

Definition at line 39 of file Tag.php.

const STATUS_DISABLED = -1

Definition at line 37 of file Tag.php.

const STATUS_PENDING = 0

Definition at line 38 of file Tag.php.


The documentation for this class was generated from the following file:

Generated on Sat Jul 4 17:24:53 2009 for Magento by  doxygen 1.5.8