GetList
Description and parameters
CDBResult
CPosting::GetList(
$aSort = Array(),
$arFilter = Array(),
$arSelect = Array(),
$arNavStartParams = false
);
Method returns list of posts by filters. Non-static method.
Parameters
Parameter | Description | Available from version |
---|---|---|
aSort | Array, containing sorting attribute as a set of "field name"=>"direction".
Field name can have the following value:
|
|
arFilter | Array, containing filter as a set of "field name"=>"filter value".
Field name can have the following value:
|
|
arSelect | Array, containing the list of [link=17038943]CPostingGeneral fields[/link]. | |
arNavStartParams | Optional. By default, false - do not limit the printed elements. Passes array with keys to limit printed elements:
Passing an empty array to the parameter arNavStartParams, sets the value to 10 of displayed/printed elements. |
Returned values
Returns the result of CDBResult type. Upon retrieval from the result by the methods of CDBResult class - now [link=17038943]"Post" object fields[/link] become available, with exception of 'text' fields.
When filter fields contain an error, the class variable LAST_ERROR contains an error message.
Examples
$cPosting = new CPosting;
$arFilter = Array(
"ID" => $find_id,
"TIMESTAMP_1" => $find_timestamp_1,
"TIMESTAMP_2" => $find_timestamp_2,
"DATE_SENT_1" => $find_date_sent_1,
"DATE_SENT_2" => $find_date_sent_2,
"STATUS" => $find_status,
"STATUS_ID" => $find_status_id,
"SUBJECT" => $find_subject,
"FROM" => $find_from,
"TO" => $find_to,
"BODY" => $find_body,
"BODY_TYPE" => $find_body_type
);
$rsPosting = $cPosting->GetList(array($by=>$order), $arFilter);
$strError .= $cPosting->LAST_ERROR;
$rsPosting->NavStart(50);
echo $rsPosting->NavPrint("Issues");
while($rsPosting->NavNext(true, "f_"))
{
//...
}
© «Bitrix24», 2001-2024