protected function _beforeSave() { if ($this->_campaign) { $this->setCampaignId($this->_campaign->getId()); } if ($this->_recipient) { $this->setRecipientId($this->_recipient->getId()); } return parent::_beforeSave(); }
/** * Set recipient model * * @param Mzax_Emarketing_Model_Recipient $recipient * @return Mzax_Emarketing_Model_Link */ public function setRecipient(Mzax_Emarketing_Model_Recipient $recipient) { $this->_recipient = $recipient; $this->setRecipientId($recipient->getId()); return $this; }