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:
| |
arFilter | Array of the array("filtered field"=>"filter value" [, ...]) type. Filtered field can have the following values:
"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