Documentation

CChapter::GetCount

int
CChapter::GetCount(
 array arFilter = Array()
);

The GetCount method returns the number of chapters that match the passed filter fields.

Parameters

ParameterDescription
arFilter The array array("filtered field"=>"filter value" [, ...]). Filter description is available in CChapter::GetList.

Return Values

The method returns the number of chapters.

See Also

  • CChapter::GetList

    Example

    
    <?
    if (CModule::IncludeModule("learning"))
    {
        $COURSE_ID = 97;
        
        $cnt = CChapter::GetCount(Array("ACTIVE" => "Y", 
                                        "COURSE_ID" => $COURSE_ID));
    
        echo "Number of chapters: ".$cnt;
    }
    ?>

    
    <?
    if (CModule::IncludeModule("learning"))
    {
        $COURSE_ID = 97;
        
        $cnt = CChapter::GetCount(Array("CHECK_PERMISSIONS" => "N", 
                                        "COURSE_ID" => $COURSE_ID));
    
        echo "Number of chapters: ".$cnt;
    }
    ?>
  • © «Bitrix24», 2001-2024