WYSIJA_model_campaign

The MailPoet Newsletters WYSIJA model campaign class.

Defined (1)

The class is defined in the following location(s).

/models/campaign.php  
  1. class WYSIJA_model_campaign extends WYSIJA_model{ 
  2.  
  3. var $pk='campaign_id'; 
  4. var $table_name='campaign'; 
  5. var $columns=array( 
  6. 'campaign_id'=>array('type'=>'integer'),  
  7. 'name'=>array('req'=>true),  
  8. 'description' => array(),  
  9. ); 
  10. var $escapeFields=array('name', 'description'); 
  11. var $escapingOn=true; 
  12.  
  13. function __construct() { 
  14. parent::__construct(); 
  15.  
  16. function getDetails($email_id=false) { 
  17. if(!$email_id) $email_id=$_REQUEST['id']; 
  18.  
  19. $where_condition=array('email_id'=>$email_id); 
  20.  
  21. $data=array(); 
  22. $model_email=WYSIJA::get('email', 'model'); 
  23. $data['email']=$model_email->getOne(false, $where_condition); 
  24.  
  25. $data['campaign']=$this->getOne(false, array('campaign_id'=>$data['email']['campaign_id'])); 
  26.  
  27.  
  28. $model_campaign_list=WYSIJA::get('campaign_list', 'model'); 
  29. $data['campaign']['lists']['full']=$model_campaign_list->get(array('list_id', 'filter'), array('campaign_id'=>$data['email']['campaign_id'])); 
  30.  
  31. foreach($data['campaign']['lists']['full'] as $list) { 
  32. $data['campaign']['lists']['ids'][]=$list['list_id']; 
  33.  
  34. return $data;