• Модуль: tasks
  • Путь к файлу: ~/bitrix/modules/tasks/lib/internals/database/mesh.php
  • Класс: BitrixTasksInternalsDataBasedeprecated
  • Вызов: deprecated::deleteLink
static function deleteLink($id, $parentId = false, array $behaviour = array('CHILDREN' => 'unlink'))
{
	static::applyDeleteRestrictions($id, $parentId);

	$fromPart = 	static::getParents($parentId);
	$toPart = 		static::getChildren($id);

	// UNlink each child (including $id) from each parent (including $parentId)
	foreach($fromPart as $parent)
	{
		foreach($toPart as $child)
		{
			$decrement = 0;

			if($parent['ID'] == $parentId && $child['ID'] == $id) // special, direct linking to parent
			{
			}
			else
			{
				if(intval($parent['MPCITY']) > 1)
				{
					$decrement += intval($parent['MPCITY']);
				}
				if(intval($child['MPCITY']) > 1)
				{
					$decrement += intval($child['MPCITY']);
				}
			}

			//print_r('UnMake '.$parent['ID'].' => '.$child['ID'].' with MPCITY = '.$decrement.PHP_EOL);

			static::markEdgeToRemove($parent['ID'], $child['ID'], $decrement);
		}
	}

	static::deleteMarkedEdges();

	return new DeleteResult();
}