GetList
Description and parameters
CDBResult CSubscription::GetList( array aSort = Array(), array arFilter = Array(), array arNavStartParams = false );
Method selects list of subscriptions (subscribers) by filter. Static method.
In case aFilter parameter is not specified, the sorting will be performed by descending ID field.
Parameters
Parameter | Description | Available from version |
---|---|---|
aSort | Array, containing sorting attribute as sets "field name"=>"direction".
Field name can have the following value:
array("EMAIL"=>"ASC", "ACT"=>"DESC") | |
arFilter | Array, containing filter as set of "field name"=>"filter value".
Field name can have the following value:
array("CONFIRMED"=>"Y", "ACTIVE"=>"Y")
1 - complex conditions allowed 2 - complex conditions allowed by user ID, LOGIN, NAME, LAST_NAME |
|
arNavStartParams | Parameters for page navigation and limiting of printed items. Array type - "Parameter name"=>"Value", where parameter name
"bShowAll" - allow showing all items at page navigation "iNumPage" - page number at page navigation "nPageSize" - number items on a page at page navigation Optional. False by default - do not limit selection. |
Returned values
Returns CDBResult query result. [link=91205]"Subscription" object fields[/link] become available upon fetching from result by CDBResult methods.
Example
//which rubrics to send
$aPostRub = array();
$post_rub = CPosting::GetRubricList($post_arr["ID"]);
while($post_rub_arr = $post_rub->Fetch())
$aPostRub[] = $post_rub_arr["ID"];
//active and confirmed addresses, subscribed to rubrics
$subscr = CSubscription::GetList(
array("ID"=>"ASC"),
array("RUBRIC"=>$aPostRub, "CONFIRMED"=>"Y", "ACTIVE"=>"Y",
"FORMAT"=>$post_arr["SUBSCR_FORMAT"], "EMAIL"=>$post_arr["EMAIL_FILTER"])
);
while(($subscr_arr = $subscr->Fetch()))
$aEmail[] = $subscr_arr["EMAIL"];
© «Bitrix24», 2001-2024