Documentation

CCoursePackage::CCoursePackage

bool
CCoursePackage::CCoursePackage(
 int COURSE_ID
);

The class CCoursePackage constructor initializes the course to be exported.

Parameters

ParameterDescription
COURSE_ID The course ID.

Remarks

If an error occurs, the LAST_ERROR property will contain the error description.

See Also

  • CCoursePackage::CreatePackage
  • CCoursePackage::CreateManifest
  • Example

    
    <?
    if (CModule::IncludeModule("learning"))
    {
        $COURSE_ID = 97;
    
        if (CCourse::GetPermission($COURSE_ID) >= 'W')
        {
            @set_time_limit(0);
            $package = new CCoursePackage($COURSE_ID);
    
            if (strlen($package->LAST_ERROR) > 0)
            {
                echo "Error: ".$package->LAST_ERROR;
            }
            else
            {
                $success = $package->CreatePackage($PACKAGE_DIR = "/upload/mypackage/");
    
                if (!$success)
                    echo "Error: ".$package->LAST_ERROR;
                else
                    echo "Ok!";
            }
    
        }
    }
    ?>
    © «Bitrix24», 2001-2024