Documentation

GetCount

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

Returns the number of sections that satisfy the filter conditions.

Parameters

ParameterDescription
arFilter An array of the format Array("filter field"=>"value" [, ...])
The filter field can be the following:
  • ACTIVE - by the active state (Y|N);
  • GLOBAL_ACTIVE - by the active state with respect to those of parent sections (Y|N);
  • NAME - by name (wildcards [%_] allowed);
  • CODE - by the mnemonic code (wildcards [%_] allowed);
  • EXTERNAL_ID - by the external ID (wildcards [%_] allowed);
  • SECTION_ID - by the parent section ID;
  • DEPTH_LEVEL - by the nesting level;
  • LEFT_BORDER, RIGHT_BORDER - by left and right margins (fields LEFT_MARGIN and RIGHT_MARGIN);
  • ID - by the section ID;
  • IBLOCK_ID - by the ID of the parent information block;
  • IBLOCK_ACTIVE - by the parent information block active state;
  • IBLOCK_NAME - by the information block name (wildcards [%_] allowed);
  • IBLOCK_TYPE - by the information block type;
  • IBLOCK_CODE - by the information block mnemonic code (wildcards [%_] allowed);
  • IBLOCK_EXTERNAL_ID - by the information block external code (wildcards [%_] allowed);
All the filter fields may have the following conditions before the name:
  • "!" - not equal;
  • "<" - less than;
  • "<=" - less than or equal;
  • ">" - more than;
  • ">=" - more than or equal.
The "filter values" are a single value or an array.

The default parameter value is an empty array.

Return Values

Number of sections.

See Also

  • CIBlockSection::GetList

    Example


    <?
        $arFilter = Array(
            "IBLOCK_ID"=>$IBLOCK_ID,
            "SECTION_ID"=>$f_ID
            );
    
        echo CIBlockSection::GetCount($arFilter);
    ?>
  • © «Bitrix24», 2001-2024
    Up