Documentation

CCertification::GetList

CDBResult
CCertification::GetList(
 array arOrder = Array("ID"=>"DESC"),
 array arFilter = Array()
);

The GetList method returns a list of certificates filtered by arFilter and sorted in the arOrder order. The current user access permissions are respected.

Parameters

ParameterDescription
arOrder An array in the format array("filter field"=>"sort order" [, ...]). The sorting field can have the following values:
  • ID - the certificate ID;
  • STUDENT_ID - the student ID;
  • COURSE_ID - the course ID;
  • SUMMARY - number of points obtained while taking all tests of the course;
  • MAX_SUMMARY - maximum number of points that can be obtained;
  • SORT - sort index;
  • ACTIVE - active state flag (Y|N);
  • FROM_ONLINE - the certificate has been obtained via an online training course (Y/N);
  • PUBLIC_PROFILE - the certificate will be published in the profile (Y/N);
  • DATE_CREATE - the date when the certificate was created;
  • TIMESTAMP_X - the date when the student's information was modified.
Sort order can be one of the following:
  • asc - ascending;
  • desc - descending;

    Optional. The default value is descending.
arFilter An array in the format array("filtered field"=>"filter value" [, ...]). The following values are possible:
  • ID - the certificate ID;
  • STUDENT_ID - the student ID;
  • COURSE_ID - the course ID;
  • SUMMARY - number of points obtained while taking the tests of the course;
  • MAX_SUMMARY - maximum number of points;
  • SORT - sort index;
  • ACTIVE - active state flag (Y|N);
  • FROM_ONLINE - the certificate has been obtained via an online training course (Y/N);
  • PUBLIC_PROFILE - the certificate can be viewed in the user profile (Y/N);
  • DATE_CREATE - the date when the certificate was created;
  • TIMESTAMP_X - the date when the student's data was modified;
  • USER - the user (complex conditions of the ID, LOGIN, NAME, LAST_NAME fields are allowed);
  • MIN_PERMISSION - minimum access permission level. "R" by default. See CCourse::SetPermission for available access permissions.
  • CHECK_PERMISSIONS - the level of access permission will be checked. If set to "N", the check is not performed.
The following logic can be specified at the beginning of the field name:
  • "!" - not equal;
  • "<" - less than;
  • "<=" - less or equal;
  • ">" - more than;
  • ">=" - more or equal.
"filter values"  is a single value or an array.

Optional. By default, records are not filtered.

Return Values

The method returns an instance of the CDBResult object.

See Also

  • CDBResult
  • CCertification::GetByID
  • Certificate fields
  • Example

    
    <?
    if (CModule::IncludeModule("learning"))
    {
        $COURSE_ID = 100;
        $res = CCertification::GetList(
            Array("SUMMARY" => "DESC", "SORT"=>"ASC"), 
            Array("ACTIVE" => "Y", "COURSE_ID" => $COURSE_ID)
        );
    
        while ($arCertification = $res->GetNext())
        {
            echo "User:".$arCertification["USER_NAME"].
                 "; Course name: ".$arCertification["COURSE_NAME"]."<br>";
        }
    }
    ?>
    
    <?
    if (CModule::IncludeModule("learning"))
    {
        $COURSE_ID = 100;
        $res = CCertification::GetList(
            Array("SUMMARY" => "DESC", "SORT"=>"ASC"), 
            Array("ACTIVE" => "Y", "CHECK_PERMISSIONS" => "N")
        );
    
        while ($arCertification = $res->GetNext())
        {
            echo "User:".$arCertification["USER_NAME"].
                 "; Course name: ".$arCertification["COURSE_NAME"]."<br>";
        }
    }
    ?>
    © «Bitrix24», 2001-2024
    Up