Created
July 13, 2012 16:53
-
-
Save lilliealbert/3105951 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function getSubscriberList(){ | |
$result = array(); | |
$startIndex = 0; | |
$limit = 500; | |
$numberOfCurrentBatchRecord = $limit; | |
$numberOfBatchRan = 0; | |
$safeGardCount = 10; | |
while($limit == $numberOfCurrentBatchRecord && $numberOfBatchRan < $safeGardCount){ | |
$startIndex = $limit * $numberOfBatchRan; | |
echo "get record from ".$startIndex." to ".($startIndex+$limit-1)."\n"; | |
$response = $this->getVREmailList($this->getMasterListId(),$startIndex,$limit); | |
$numberOfCurrentBatchRecord = count($response); | |
echo "number of record found in this batch:".$numberOfCurrentBatchRecord."\n"; | |
foreach ($response as $value){ | |
foreach ($value->member_data as $memberDataProperty){ | |
if(strcmp($memberDataProperty->name,"email_address")==0){ | |
$result[]=$memberDataProperty->value; | |
} | |
} | |
} | |
$numberOfBatchRan++; | |
} | |
return $result; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment