Documentation

CCertification::Add

int
CCertification::Add(
 array arFields
);

The Add method adds a new certificate.

Parameters

ParameterDescription
arFields The array Array("field"=>"value", ...). Contains values of all the certificate fields. Required fields must be present.

Return Values

The method returns the ID of the added certificate on success, or false otherwise. If an error occurs, the exception will contain the error description.

See Also

  • CCertification::Update
  • Fields
  • Example

    
    <?
    if (CModule::IncludeModule("learning"))
    {
        $COURSE_ID = 97;
        $STUDENT_ID = 3;
    
        $arFields = Array(
            "ACTIVE" => "Y",
            "COURSE_ID" => $COURSE_ID,
            "STUDENT_ID" => $STUDENT_ID,
            "SUMMARY" => 300,
            "MAX_SUMMARY" => 300
        );
    
        $certificate = new CCertification;
        $ID = $certificate->Add($arFields);
        $success = ($ID>0);
    
        if($success)
        {
            echo "Ok!";
        }
        else
        {
            if($e = $APPLICATION->GetException())
                echo "Error: ".$e->GetString();
        }
    
    }
    ?>
    © «Bitrix24», 2001-2024
    Up