Mage_Poll_Model_Poll_Answer Class Reference

Inheritance diagram for Mage_Poll_Model_Poll_Answer:

Mage_Core_Model_Abstract Varien_Object

List of all members.

Public Member Functions

 countPercent ($poll)

Protected Member Functions

 _construct ()
 _afterSave ()
 _beforeDelete ()
 _afterDelete ()


Detailed Description

Definition at line 35 of file Answer.php.


Member Function Documentation

_afterDelete (  )  [protected]

Processing object after delete data

Returns:
Mage_Core_Model_Abstract

Reimplemented from Mage_Core_Model_Abstract.

Definition at line 60 of file Answer.php.

00061     {
00062         Mage::getModel('poll/poll')
00063             ->setId($this->getPollId())
00064             ->resetVotesCount();
00065     }

_afterSave (  )  [protected]

Processing object after save data

Returns:
Mage_Core_Model_Abstract

Reimplemented from Mage_Core_Model_Abstract.

Definition at line 48 of file Answer.php.

00049     {
00050         Mage::getModel('poll/poll')
00051             ->setId($this->getPollId())
00052             ->resetVotesCount();
00053     }

_beforeDelete (  )  [protected]

Processing object before delete data

Returns:
Mage_Core_Model_Abstract

Reimplemented from Mage_Core_Model_Abstract.

Definition at line 55 of file Answer.php.

00056     {
00057         $this->setPollId($this->load($this->getId())->getPollId());
00058     }

_construct (  )  [protected]

Enter description here...

Reimplemented from Varien_Object.

Definition at line 37 of file Answer.php.

00038     {
00039         $this->_init('poll/poll_answer');
00040     }

countPercent ( poll  ) 

Definition at line 42 of file Answer.php.

00043     {
00044         $this->setPercent(round(( $poll->getVotesCount() > 0 ) ? ($this->getVotesCount() * 100 / $poll->getVotesCount()) : 0));
00045         return $this;
00046     }


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

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