• Модуль: tasks
  • Путь к файлу: ~/bitrix/modules/tasks/lib/internals/database/tree.php
  • Класс: BitrixTasksInternalsDataBaseis
  • Вызов: is::checkLinkExists
static function checkLinkExists($id, $parentId)
{
	$parentColName = static::getPARENTIDColumnName();
	$idColName = static::getIDColumnName();
	$directColName = static::getDIRECTColumnName();

	$id = intval($id);
	$parentId = intval($parentId);
	if(!$id || !$parentId)
	{
		return false; // link to non-existed nodes does not exist
	}

	$item = MainHttpApplication::getConnection()->query("select ".$idColName." from ".static::getTableName()." where ".$idColName." = '".$id."' and ".$parentColName." = '".$parentId."' and ".$directColName." = '1'")->fetch();
	return is_array($item);
}