bool CChapter::Update( int ID, array arFields );
The Update method modifies the parameters of the specified chapter.
| Parameter | Description |
|---|---|
| ID | The chapter ID. |
| arFields | The array Array("field"=>"value", ...). Contains values of all chapter fields. Required fields must be present. |
The method returns true on successful update, or false otherwise. If an error occurs, the exception will contain the error description.
<?
if (CModule::IncludeModule("learning"))
{
$CHAPTER_ID = 299;
$arFields = Array(
"ACTIVE" => "N",
"NAME" => "New name of Chapter 1",
"SORT" => "555",
);
$chapter = new CChapter;
$success = $chapter->Update($CHAPTER_ID, $arFields);
if($success)
{
echo "Ok!";
}
else
{
if($e = $APPLICATION->GetException())
echo "Error: ".$e->GetString();
}
}
?>| © 2001-2007 Bitrix | Bitrix Site Manager - Content Management & Portal Solutions |