本文整理匯總了PHP中Bitrix\Highloadblock\HighloadBlockTable::update方法的典型用法代碼示例。如果您正苦於以下問題:PHP HighloadBlockTable::update方法的具體用法?PHP HighloadBlockTable::update怎麽用?PHP HighloadBlockTable::update使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Bitrix\Highloadblock\HighloadBlockTable
的用法示例。
在下文中一共展示了HighloadBlockTable::update方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: updateHlblock
public function updateHlblock($hlblockId, $fields)
{
$result = HL\HighloadBlockTable::update($hlblockId, $fields);
if ($result->isSuccess()) {
return true;
}
$this->throwException(__METHOD__, implode(', ', $result->getErrors()));
}
示例2: LocalRedirect
$entity_data_class = $entity->getDataClass();
$entity_table_name = $hlblock['TABLE_NAME'];
$hlblock['ROWS_COUNT'] = $entity_data_class::getCount();
}
$isEditMode = true;
// delete action
if ($is_update_form && isset($_REQUEST['action']) && $_REQUEST['action'] === 'delete' && check_bitrix_sessid()) {
HL\HighloadBlockTable::delete($hlblock['ID']);
LocalRedirect("highloadblock_index.php?lang=" . LANGUAGE_ID);
}
// save action
if ((strlen($save) > 0 || strlen($apply) > 0) && $REQUEST_METHOD == "POST" && check_bitrix_sessid()) {
$data = array('NAME' => trim($_REQUEST['NAME']), 'TABLE_NAME' => trim($_REQUEST['TABLE_NAME']));
if ($is_update_form) {
$ID = intval($_REQUEST['ID']);
$result = HL\HighloadBlockTable::update($ID, $data);
} else {
// create
$result = HL\HighloadBlockTable::add($data);
$ID = $result->getId();
}
if ($result->isSuccess()) {
if (strlen($save) > 0) {
LocalRedirect("highloadblock_index.php?lang=" . LANGUAGE_ID);
} else {
LocalRedirect("highloadblock_entity_edit.php?ID=" . $ID . "&lang=" . LANGUAGE_ID . "&" . $tabControl->ActiveTabParam());
}
} else {
$errors = $result->getErrorMessages();
}
// rewrite original value by form value to restore form