Documentation

GetList

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

Returns list of "task -> file" associations by the arFilter filter, sorted by the arOrder.

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

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;
  • FILE - file ID. 
Direction of sorting can have the following values:
  • asc - by ascension;
  • desc - by descension;
Optional. By default it is filtered by task ID descension.
arFilter Array of the array("filetered field"=>"filter value" [, ...]) type. Filtered field can have the following values:
  • TASK_ID - task ID;
  • FILE_ID - file ID.
Prior to naming the filtered field, the type of filtration can be specified:
  • "!" - not equal
  • "<" - less
  • "<=" - less or equal
  • ">" - more
  • ">=" - more or equal

"filter values" - single value or an array.

Optional. By default, records are not filtered.

Returned value

CDBResult object is returned. 

Examples of use

<?

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

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

?>


© «Bitrix24», 2001-2024
Up