• Модуль: tasks
  • Путь к файлу: ~/bitrix/modules/tasks/lib/internals/task/favorite.php
  • Класс: BitrixTasksInternalsTaskFavoriteTable
  • Вызов: FavoriteTable::deleteByTaskId
static function deleteByTaskId($taskId, $behaviour = array('LOW_LEVEL' => false))
{
	$taskId = Assert::expectIntegerPositive($taskId, '$taskId');

	if (!is_array($behaviour))
		$behaviour = array();
	if (!isset($behaviour['LOW_LEVEL']))
		$behaviour['LOW_LEVEL'] = false;

	if ($behaviour['LOW_LEVEL'])
	{
		HttpApplication::getConnection()->query("delete from " . static::getTableName() . " where TASK_ID = '" . intval($taskId) . "'");

		$result = true;
	}
	else
	{
		$result = array();

		$res = static::getList(array('filter' => array('=TASK_ID' => $taskId)));
		while ($item = $res->fetch())
		{
			$result[] = static::delete(array('TASK_ID' => $item['TASK_ID'], 'USER_ID' => $item['USER_ID']));
		}
	}

	return $result;
}