Documentation

toggleFavorite

public function toggleFavorite()

Changes favorite state for the specified task.

Returned value

Returns true, if the task wasn't initially included into Favorites. Otherwise, returns false.

Example of use

    // switching the favorites state
   $task = new CTaskItem(10, $GLOBALS['USER']->GetId()); 
   $task->toggleFavorite();  

© «Bitrix24», 2001-2024