GetProperties
array _CIBElement::GetProperties( arOrder = Array("sort" => "asc"), arFilter = Array() );
The method returns property values of this information block element.
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:
|
arFilter |
Optional additional filter in the form of Array("Filtered
field"=>"Value", ...). The Filtered field
can be the following:
|
Return Values
The method returns the property values array with the key in the form of either symbolic code or the numeric ID and the value of an array containing the property fields and the additional keys and values:
- "VALUE" => "property value or an array for a multiple property";
- "VALUE_ENUM_ID" => "option ID for the LIST properties (array or a single value)";
- "DESCRIPTION" => "property value description (array or a single value)";
- "PROPERTY_VALUE_ID" => "property value ID (array or a single value)"
See Also
Example
<? include($_SERVER['DOCUMENT_ROOT'].'/bitrix/header.php'); if(CModule::IncludeModule('iblock')) { $dbEl = CIBlockElement::GetList(Array(), Array("IBLOCK_TYPE"=>"catalog", "IBLOCK_ID"=>11)); if($obEl = $dbEl->GetNextElement()) { $props = $obEl->GetProperties(); echo "<pre>"; print_r($props); echo "</pre>"; } } ?> <?include($_SERVER['DOCUMENT_ROOT'].'/bitrix/footer.php');?>
Sample output:
Array ( [27] => Array ( [ID] => 27 [TIMESTAMP_X] => 20041222191551 [IBLOCK_ID] => 11 [NAME] => Battery [ACTIVE] => Y [SORT] => 500 [CODE] => [DEFAULT_VALUE] => [PROPERTY_TYPE] => L [ROW_COUNT] => 1 [COL_COUNT] => 30 [LIST_TYPE] => L [MULTIPLE] => Y [XML_ID] => [FILE_TYPE] => [MULTIPLE_CNT] => 5 [TMP_ID] => [WITH_DESCRIPTION] => [LINK_IBLOCK_ID] => 0 [VALUE_TYPE] => text [VALUE_ENUM] => Li-Mon [VALUE] => Array ( [0] => Li-Test [1] => Li-NEW [2] => Li-Mon ) [~VALUE] => Array ( [0] => Li-Test [1] => Li-NEW [2] => Li-Mon ) [DESCRIPTION] => Array ( [0] => [1] => [2] => ) [~DESCRIPTION] => Array ( [0] => [1] => [2] => ) [PROPERTY_VALUE_ID] => Array ( [0] => 53860 [1] => 53861 [2] => 53862 ) [VALUE_ENUM_ID] => Array ( [0] => 18 [1] => 19 [2] => 20 ) [~NAME] => Battery [~DEFAULT_VALUE] => ) [28] => Array ( [ID] => 28 [TIMESTAMP_X] => 20041222191551 [IBLOCK_ID] => 11 [NAME] => Screen [ACTIVE] => Y [SORT] => 500 [CODE] => [DEFAULT_VALUE] => [PROPERTY_TYPE] => S [ROW_COUNT] => 1 [COL_COUNT] => 30 [LIST_TYPE] => L [MULTIPLE] => Y [XML_ID] => [FILE_TYPE] => [MULTIPLE_CNT] => 5 [TMP_ID] => [WITH_DESCRIPTION] => [LINK_IBLOCK_ID] => 0 [VALUE_TYPE] => [VALUE_ENUM] => [VALUE] => Color [~VALUE] => Color [DESCRIPTION] => [~DESCRIPTION] => [PROPERTY_VALUE_ID] => 32862 [~NAME] => Screen [~DEFAULT_VALUE] => ) [29] => Array ( [ID] => 29 [TIMESTAMP_X] => 20041222191551 [IBLOCK_ID] => 11 [NAME] => PropertyX [ACTIVE] => Y [SORT] => 500 [CODE] => [DEFAULT_VALUE] => [PROPERTY_TYPE] => N [ROW_COUNT] => 1 [COL_COUNT] => 30 [LIST_TYPE] => L [MULTIPLE] => Y [XML_ID] => [FILE_TYPE] => [MULTIPLE_CNT] => 5 [TMP_ID] => [WITH_DESCRIPTION] => [LINK_IBLOCK_ID] => 0 [VALUE_TYPE] => [VALUE_ENUM] => [VALUE] => [~VALUE] => [DESCRIPTION] => [~DESCRIPTION] => [PROPERTY_VALUE_ID] => [~NAME] => PropertyX [~DEFAULT_VALUE] => ) [FORUM_TOPIC_ID] => Array ( [ID] => 383 [TIMESTAMP_X] => 20041223132810 [IBLOCK_ID] => 11 [NAME] => FORUM_TOPIC_ID [ACTIVE] => Y [SORT] => 500 [CODE] => FORUM_TOPIC_ID [DEFAULT_VALUE] => [PROPERTY_TYPE] => N [ROW_COUNT] => 1 [COL_COUNT] => 30 [LIST_TYPE] => L [MULTIPLE] => N [XML_ID] => [FILE_TYPE] => [MULTIPLE_CNT] => 5 [TMP_ID] => [WITH_DESCRIPTION] => [LINK_IBLOCK_ID] => 0 [VALUE_TYPE] => [VALUE_ENUM] => [VALUE] => [~VALUE] => [DESCRIPTION] => [~DESCRIPTION] => [PROPERTY_VALUE_ID] => [~NAME] => FORUM_TOPIC_ID [~DEFAULT_VALUE] => ) [386] => Array ( [ID] => 386 [TIMESTAMP_X] => 20050119162457 [IBLOCK_ID] => 11 [NAME] => Photo [ACTIVE] => Y [SORT] => 500 [CODE] => [DEFAULT_VALUE] => [PROPERTY_TYPE] => F [ROW_COUNT] => 1 [COL_COUNT] => 30 [LIST_TYPE] => L [MULTIPLE] => N [XML_ID] => [FILE_TYPE] => [MULTIPLE_CNT] => 5 [TMP_ID] => [WITH_DESCRIPTION] => Y [LINK_IBLOCK_ID] => 0 [VALUE_TYPE] => text [VALUE_ENUM] => [VALUE] => 2309 [~VALUE] => 2309 [DESCRIPTION] => HP [~DESCRIPTION] => HP [PROPERTY_VALUE_ID] => 53863 [~NAME] => Photo [~DEFAULT_VALUE] => ) )
© «Bitrix24», 2001-2024