Documentation

GetList

CDBResult
CTaskReminders::GetList(
 array arOrder = array(),
 array arFilter = array()
);

This method returns a list of notifications for tasks by the arFilter filter, sorted by the arOrder order.

Method parameters

Parameter Description
arOrder Array for result sorting. Array of the array("sorting field"=>"sorting direction" [, ...]) type.
Field for sorting can have the following values:
  • TASK - task ID;
  • USER - user ID;
  • DATE - date of notification. 
Sorting direction can have the following values:
  • asc - by ascension;
  • desc - by descension;
Optional. Be default, it is filtered by descension of task ID.
arFilter

Array of the array("filtered field"=>"filter value" [, ...]) type. Filtered field can have the following values:

  • TASK_ID - task ID;
  • USER_ID - user ID;
  • REMIND_DATE - date of notification.

Type of filtration can be specified in front of filtered field name:
  • "!" - not equal
  • "<" - less
  • "<=" - less or equal
  • ">" - more
  • ">=" - more or equal

"filter name" - single value or an array.

Optional. By default, records are not filtered.

Returned value

CDBResult object is returned. 

Examples of use

<?

// Select all notifications for the task with ID = 2 for the current user
if (CModule::IncludeModule("tasks"))
{
$res = CTaskReminders::GetList(
Array("DATE" => "ASC"),
Array("TASK_ID" => "2", "USER_ID" => $USER->GetID())
);

while ($arReminder = $res->GetNext())
{
echo $arReminder["REMIND_DATE"]."<br>";
}
}

?>


© «Bitrix24», 2001-2024