Add
bool CTaskTags::Add( array arFields );
This method adds tags for a task.
Method parameters
Parameter | Description |
---|---|
arFields | Array("field"=>"value", ...). Contains TASK_ID field - task ID, USER_ID - user ID and NAME - tag. |
Returned value
The method returns true, when the adding was successful. If an error occurs, the method will return false, and exceptions will contain errors.
Examples of use
<?
if (CModule::IncludeModule("tasks"))
{
$arFields = Array(
"TASK_ID" => 4,
"USER_ID" => 15,
"NAME" => "task 2.0",
);
$obTaskTags = new CTaskTags;
$ID = $obTaskTags->Add($arFields);
$success = ($ID>0);
if($success)
{
echo "Ok!";
}
else
{
if($e = $APPLICATION->GetException())
echo "Error: ".$e->GetString();
}
}?>
© «Bitrix24», 2001-2024