Documentation

ConvertFromDB

array
CIBlockProperty*::ConvertFromDB(
array arProperty,
array value
);

The method converts property value from database format to the target format to be processed. Returns an array type ("VALUE" => "...", "DESCRIPTION" => "..."). Additional method to the ConvertToDB. Method is static when using standard properties. The method must be static for the properties created by the client when using php7.

Note: Invoked in the method CIBlockResult::Fetch. To operate correctly, specify "IBLOCK_ID" in the method filter CIBlockElement::GetList.

Call parameters

Parameter Description
arProperty
Property metadata. See Iblock element properties
valueProperty value read from the database. Array type as follows:
array(
"VALUE" => value,
"DESCRIPTION" => description,
);

Returned value

External presentation of property value.

See Also

Examples

<?
class CIBlockPropertyMyDateTime
{
function ConvertFromDB($arProperty, $value)
{
if(strlen($value["VALUE"])>0)
{
$value["VALUE"] = CDatabase::FormatDate(
$value["VALUE"],
"YYYY-MM-DD HH:MI:SS",
CLang::GetDateFormat("FULL")
);
//Delete insignificante zeros
$value["VALUE"] = str_replace(" 00:00:00", "", $value["VALUE"]);
}
return $value;
}
}
?>


© «Bitrix24», 2001-2024
Up