Documentation

CCourse::Delete

bool
CCourse::Delete(
 int ID
);

The Delete course deletes the course identified by the ID.

Remarks

If any certificates were obtained for the specified course, the method returns false.

Parameters

ParameterDescription
ID The course ID.

Return Values

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

Example


<?

if (CModule::IncludeModule("learning"))
{

    $ID = 109;//Course ID

    if($USER->IsAdmin())
    {
        @set_time_limit(0);
        $DB->StartTransaction();
        if(!CCourse::Delete($ID))
            $DB->Rollback();
        else
            $DB->Commit();
    }

}
?>
© «Bitrix24», 2001-2024
Up