Documentation

GetList

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

Returns the list of "task" -> "previous task" links by the arFilter, sorted by the arOrder.

Note: The method accepts an array of configuration parameters and generates scripts, necessary to show file dialog. Static method.

Method parameters

Parameter Description
arOrder Array for sorting of result. Array of the array("sorting field"=>"sorting direction" [, ...]).
Field for sorting can have the following values:
  • TASK - task ID;
  • DEPENDS_ON_ID - previous task ID. 
Direction of sorting can have the following values:
  • asc - by ascension;
  • desc - by descension;
Optional. By default, it is filtered by descending task ID.
arFilter Array of the array("filtered field"=>"filter value" [, ...]) type. Filtered field can have the following values:
  • TASK_ID - task ID;
  • DEPENDS_ON_ID - previous task ID.
Type of filtration can be specified in front of filtered field:
  • "!" - not equal
  • "<" - less
  • "<=" - less or equal
  • ">" - more
  • ">=" - more or equal

"filter values" - single value or array.

Optional. By default, records are not filtered.

Returned value

CDBResult object is returned. 

Examples of use

<?

// Select all previous task for the specified task with ID = 2
if (CModule::IncludeModule("tasks"))
{
$res = CTaskDependence::GetList(
Array("DEPENDS_ON_ID" => "ASC"),
Array("TASK_ID" => "2")
);

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

?>


© «Bitrix24», 2001-2024