• Модуль: vote
  • Путь к файлу: ~/bitrix/modules/vote/classes/general/vote.php
  • Класс: CAllVote
  • Вызов: CAllVote::Update
static function Update($ID, $arFields, $strUploadDir = false)
{
	$result = BitrixVoteVoteTable::update($ID, $arFields);
	if (!$result->isSuccess())
	{
		$aMsg = [];
		$errCollection = $result->getErrorCollection();
		for ($errCollection->rewind(); $errCollection->valid(); $errCollection->next())
		{
			/** @var Error $error */
			$error = $errCollection->current();
			$aMsg[] = ["id" => $error->getCode(), "text" => $error->getMessage()];
		}
		if (!empty($aMsg))
		{
			global $APPLICATION;
			$APPLICATION->ThrowException((new CAdminException(array_reverse($aMsg))));
		}
		return false;
	}
	return $result->getId();
}