Documentation

CChapter::Delete

bool
CChapter::Delete(
 int ID
);

The Delete method deletes the specified chapter.

Parameters

ParameterDescription
ID The chapter ID.

Return Values

The method returns true if the chapter has been successfully deleted, or false otherwise.

Example


<?
if (CModule::IncludeModule("learning"))
{
    $COURSE_ID = 97;
    $CHAPTER_ID = 300;

    if (CCourse::GetPermission($COURSE_ID) >= 'W')
    {
        @set_time_limit(0);
        $DB->StartTransaction();
        if (!CChapter::Delete($CHAPTER_ID))
        {
            echo "Error!";
            $DB->Rollback();
        }
        else
            $DB->Commit();
    }
}
?>
© «Bitrix24», 2001-2024