Forked from MasterHans/1С Битрикс Получить массив значаний свойства элемента инфоблока
Created
March 4, 2023 12:14
-
-
Save EscApp2/75e9e63a068a5844766b065e8a32c8b6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Получить массив значаний свойства элемента инфоблока | |
*/ | |
function getArrayOfPropertyValues($ELEMENT_ID, $PROPERTY_CODE) | |
{ | |
$arrValues = []; | |
//Получаем значение свойств инфоблока | |
$db_props = CIBlockElement::GetProperty( | |
MAIN_CATALOG_IB_ID, | |
$ELEMENT_ID, | |
array("sort" => "asc"), | |
array("CODE" => $PROPERTY_CODE) | |
); | |
while ($ar_props = $db_props->Fetch()) { | |
if (!is_null($ar_props["VALUE"])) { | |
$arrValues[] = $ar_props["VALUE"]; | |
} | |
} | |
return $arrValues; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment