/**
  * @param integer $listContentobjectId
  * @param integer $limit
  * @param integer $offset
  * @param boolean $asObject
  * @return array
  */
 static function fetchSubscriptionList($listContentobjectId, $status, $limit, $offset, $asObject)
 {
     $statusId = false;
     switch ($status) {
         case 'pending':
             $statusId = CjwNewsletterSubscription::STATUS_PENDING;
             break;
         case 'confirmed':
             $statusId = CjwNewsletterSubscription::STATUS_CONFIRMED;
             break;
         case 'approved':
             $statusId = CjwNewsletterSubscription::STATUS_APPROVED;
             break;
         case 'removed':
             $statusId = array(CjwNewsletterSubscription::STATUS_REMOVED_ADMIN, CjwNewsletterSubscription::STATUS_REMOVED_SELF);
             break;
         case 'bounced':
             $statusId = array(CjwNewsletterSubscription::STATUS_BOUNCED_SOFT, CjwNewsletterSubscription::STATUS_BOUNCED_HARD);
             break;
         case 'blacklisted':
             $statusId = CjwNewsletterSubscription::STATUS_BLACKLISTED;
             break;
         default:
             break;
     }
     $objectList = CjwNewsletterSubscription::fetchSubscriptionListByListId($listContentobjectId, $statusId, $limit, $offset, $asObject);
     return array('result' => $objectList);
 }
Пример #2
0
 /**
  * get all subscriptions of current this static list
  *
  * @param integer $status e.g. @param integer $status e.g. CjwNewsletterSubscription::STATUS_APPROVED
  * @param integer $limit
  * @param integer $offset
  * @param boolean $asObject
  * @return Ambigous <multitype:, NULL, unknown, multitype:unknown >
  */
 function getSubscriptionObjectArray($status, $limit = 0, $offset = 0, $asObject = true)
 {
     // if static list
     //$listContentObjectId = $this->attribute( 'contentobject_id' );
     $subscriptionObjectList = CjwNewsletterSubscription::fetchSubscriptionListByListId($this, $status, $limit, $offset, $asObject);
     return $subscriptionObjectList;
 }