• Модуль: calendar
  • Путь к файлу: ~/bitrix/modules/calendar/lib/rooms/categories/manager.php
  • Класс: BitrixCalendarRoomsCategoriesManager
  • Вызов: Manager::deleteCategory
public function deleteCategory(): Manager
{
	if ($this->getError())
	{
		return $this;
	}

	$this->category->delete();

	if ($this->category->getError())
	{
		$this->addError($this->category->getError());
	}

	global $DB;
	$tableName = LocationTable::getTableName();
	$categoryId = $this->category->getId();

	$DB->Query("
		UPDATE $tableName
		SET CATEGORY_ID = null
		WHERE CATEGORY_ID = $categoryId
	");

	return $this;
}