Documentation

GetList

CDBResult
CIBlockProperty::GetList(
 array arOrder = Array(),
 array arFilter = Array()
);

Returns a filtered and sorted list of properties.

Parameters

ParameterDescription
arOrder Optional sort order. Array of the format Array(by1=>order1[, by2=>order2 [, ..]]) where by is the field for sorting. The field can have the following values:
  • id - property ID;
  • block_id - information block ID;
  • name - name;
  • active - property is active;
  • sort - sort weight;
  • timestamp_x - modification date;
  • searchable - by the fact that the property value should be indexed;
  • filtrable - by the fact that the fields for filtering by this property should be displayed in Control Panel.
order is the sort order. Can be asc for ascending sorts or desc for descending.
arFilter An array of the format Array("filter field"=>"value" [, ...]) where "filter field" can be the following:
  • ACTIVE - by the active state (Y|N);
  • CODE - by the mnemonic code (wildcards [%_] allowed);
  • NAME - by name (wildcards [%_] allowed);
  • EXTERNAL_ID or XML_ID - by the external ID (wildcards [%_] allowed; negation allowed: !EXTERNAL_ID);
  • PROPERTY_TYPE - by property type;
  • USER_TYPE – by custom property type;
  • SEARCHABLE - by the fact that the property value should be indexed;
  • FILTRABLE - by the fact that the fields for filtering by this property should be displayed in Control Panel.
  • VERSION – by storage location of information block element property (1 - public storage, 2 - dedicated storage). See Storing properties in dedicated tables for more information;
  • IBLOCK_ID - by the ID of the parent information block;
  • IBLOCK_CODE – by the property’s underlying information block mnemonic code;
  • LINK_IBLOCK_ID – by the ID of a linked information block (this key is possible for "E" and "G" properties); Property types: "S" – string; "N" – number; "L" – list; "F" – file; "G" – link to section; "E" – link to element.
  • ID - by the identifier;
The default parameter value is an empty array.

Return Values

Returns an instance of CDBResult

See Also

  • CDBResult
  • Property fields

    Example


    <?
    $IBLOCK_ID = 11;
    $properties = CIBlockProperty::GetList(Array("sort"=>"asc", "name"=>"asc"), Array("ACTIVE"=>"Y", "IBLOCK_ID"=>$IBLOCK_ID));
    while($prop_fields = $properties->GetNext())
    {
        echo $prop_fields["ID"]." - ".$prop_fields["NAME"]."<br>";
    }
    ?>
  • © «Bitrix24», 2001-2024