Documentation

duplicate

CTaskItem[]
CTaskItem::duplicate(
          $overrideTaskData = array(),
          $parameters = array()
)

This method copies task or tasks.

Returned value

This method returns an array of copied [link=32362]CTaskItem[/link] class instances.

Method parameters

Parameter Description
$overrideTaskData Array of redefined fields when copied for the task.
$parameters Array of task parameters.

Example of use

CModule::IncludeMOdule('tasks');
$task = new CTaskItem(1005, 1);
$res = $task->duplicate();
foreach($res as $taskInst)
{
    $data = $taskInst->getData(false);
    print($data['ID'].' -> '.$data['TITLE'].PHP_EOL);
}


© «Bitrix24», 2001-2024
Up