Public Member Functions | |
countPercent ($poll) | |
Protected Member Functions | |
_construct () | |
_afterSave () | |
_beforeDelete () | |
_afterDelete () |
Definition at line 35 of file Answer.php.
_afterDelete | ( | ) | [protected] |
Processing object after delete data
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
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
Reimplemented from Mage_Core_Model_Abstract.
Definition at line 55 of file Answer.php.
_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 }