Documentation

GetList

CDBResult
CTaskElapsedTime::GetList(
 array arOrder = array(),
 array arFilter = array(),
 array arParams = array()
);

Returns list of records with elapsed time by the arFilter filter, sorted by the arOrder. Static method.

Method parameters

Parameter Description Available from version
arOrder Array for sorting of result. Array of array("after sorting"=>"sorting direction" [, ...]) type.
Field for sorting can have the following values:
  • ID - task ID;
  • USER - user ID. 
Sorting direction can be as follows:
  • asc - by ascension;
  • desc - by descension;
 Optional. By default, filtered by the date when added.
arFilter Array of the array("filtered field"=>"filter value" [, ...]) type. Filtered field can have the following values:
  • CREATED_DATE - date when added;
  • ID - record ID; 
  • USER_ID - user ID; 
  • TASK_ID - task ID.
Type of filtration can be specified in front of filtered field name:
  • "!" - not equal
  • "<" - less
  • "<=" - less or equal
  • ">" - more
  • ">=" - more or equal

"filter value" - single value or an array.

Optional. By default, records are not filtered.
arParams Array of additional parameters. Optional.

Returned value

CDBResult object is returned. 

Examples of use

<?

// Lets count the elapsed time for the task with ID = 2
if (CModule::IncludeModule("tasks"))
{
$res = CTaskElapsedTime::GetList(
Array(),
Array("TASK_ID" => "2")
);

$elapsedTime = 0;
while ($arElapsed = $res->Fetch())
{
$elapsedTime += $arElapsed["MINUTES"];
}
echo "Elapsed time: ".floor($elapsedTime / 60)."ч. ".($elapsedTime % 60)."м.";
}

?>


© «Bitrix24», 2001-2024