Beispiel #1
0
 /**
  * Retrieve campaign
  *
  * @return Mzax_Emarketing_Model_Campaign
  */
 public function getCampaign()
 {
     if (!$this->_campaign) {
         $this->_campaign = Mage::getModel('mzax_emarketing/campaign');
         $this->_campaign->load($this->getCampaignId());
     }
     return $this->_campaign;
 }
Beispiel #2
0
 /**
  * Retreive current campaign
  * 
  * We must always return a campaign object!
  * getQuery() needs to work with no data set
  * 
  * @return Mzax_Emarketing_Model_Campaign
  */
 public function getCampaign()
 {
     if (!$this->_campaign) {
         $id = $this->getDataSetDefault('campaign');
         if ($id === 'current') {
             $this->_campaign = $this->getParam('campaign');
         }
         if (!$this->_campaign instanceof Mzax_Emarketing_Model_Campaign) {
             $this->_campaign = Mage::getModel('mzax_emarketing/campaign');
             if ($id > 0) {
                 $this->_campaign->load($id);
             }
         }
     }
     return $this->_campaign;
 }