• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/classes/general/eventmessage.php
  • Класс: CEventType
  • Вызов: CEventType::Update
static function Update($arID = array(), $arFields = array())
{
	$ID = array();

	// update event type by ID, or (LID+EVENT_NAME)
	if (is_array($arID) && !empty($arID))
	{
		foreach ($arID as $key => $val)
		{
			if (in_array($key, array("ID", "LID", "EVENT_NAME")))
				$ID[$key] = $val;
		}
	}
	if (!empty($ID) && CEventType::CheckFields($arFields, "UPDATE", $ID))
	{
		unset($arFields["ID"]);

		$affectedRowsCount = 0;
		$result = false;
		$listDb = MailInternalEventTypeTable::getList(array(
			'select' => array('ID'),
			'filter' => $ID
		));
		while($arListId = $listDb->fetch())
		{
			$result = MailInternalEventTypeTable::update($arListId['ID'], $arFields);
			$affectedRowsCount += $result->getAffectedRowsCount();
		}

		$res = new CDBResultEventMultiResult();
		$res->affectedRowsCount = $affectedRowsCount;

		return $res;
	}
	return false;
}