CIBlockPropertyEnum::GetList
CDBResult
CIBlockPropertyEnum::GetList(
array arOrder = Array("SORT"=>"ASC", "VALUE"=>"ASC"),
array arFilter = Array()
);
Returns a filtered and sorted list of the LIST property value options.
Parameters
Parameter | Description |
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 - by the option ID;
- value - by option value;
- sort - by sort weight;
- external_id - by external ID of an option;
- def - by the attribute default;
- property_id - by the property ID;
- property_sort - by the property sort weight;
- property_code - by the mnemonic property code.
order is the sort order. Can be asc for ascending
sorts or desc for descending. |
arFilter |
Optional additional filter by fields in the form of Array("Filtered
field"=>"Value", ...). The Filtered field
can be the following:
- VALUE - by value (wildcards [%_] allowed);
- ID - by the option value ID;
- SORT - by sort weight;
- DEF - by the attribute default (Y/N);
- EXTERNAL_ID - by external ID (wildcards [%_] allowed);
- CODE - by mnemonic identifier (wildcards [%_] allowed);
- PROPERTY_ID - by the property ID or mnemonic code;
- IBLOCK_ID - by the parent information block ID.
The default parameter value is an empty array.
|
Return Values
Returns an instance of
CDBResult
See Also
CDBResult
Possible values for properties of the type LIST
Example
<?
$property_enums = CIBlockPropertyEnum::GetList(Array("DEF"=>"DESC",
"SORT"=>"ASC"),
Array("IBLOCK_ID"=>$IBLOCK_ID,
"CODE"=>"COLORS"));
while($enum_fields = $property_enums->GetNext())
{
echo $enum_fields["ID"]." - ".$enum_fields["VALUE"]."<br>";
}
?>