Documentation

GetPropertyEnum

CDBResult
CIBlockProperty::GetPropertyEnum(
 mixed PROP_ID, 
 array arOrder = Array("SORT"=>"asc"), 
 array arFilter = Array()
)

Returns filtered and sorted variants of the LIST property value.

Parameters

ParameterDescription
PROP_ID Numerical or mnemonic property identifier.
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 - ID;
  • value - value itself;
  • sort - sort weight.
order is the sort order. Can be asc for ascending sorts or desc for descending.
arFilter An array of the format Array("filtering field"=>"value" [, ...]) where the "filtering field" can be the following:
  • VALUE - by the property variant value (wildcards [%_] allowed);
  • IBLOCK_ID - by the ID of the parent information block;
  • ID - by the variant identifier.
The default parameter value is an empty array.

Return Values

Returns an instance of CDBResult, containing records of the property variant fields.

See Also

  • Property variant fields
  • CIBlockPropertyEnum::GetList()

    Example


    <?
    $db_enum_list = CIBlockProperty::GetPropertyEnum("IMPORTANT_NEWS", 
                                                     Array(),
                                                     Array("IBLOCK_ID"=>$BID,
                                                           "VALUE"=>"Yes"));
    if($ar_enum_list = $db_enum_list->GetNext())
    {
      $db_important_news = CIBlockElement::GetList(Array(), 
                                                   Array("IBLOCK_ID"=>$BID, 
                                                         "PROPERTY"=>
                                                             array("IMPORTANT_NEWS"=>
                                                                   $ar_enum_list["ID"])));
    }
    ?>
    
  • © «Bitrix24», 2001-2024