GetLength
int
CIBlockProperty*::GetLength(
array arProperty,
array value
);
The method returns actual length of property value. This method is required only for properties with complex structure (for example, an array). Static method when using standard properties. Must be static for properties, created by client when using php7.
Note: this method is called when checking if the property fill-in is mandatory before adding or modifying an element, if property is marked as required.
Call parameters
Parameter | Description |
---|---|
arProperty
| Property metadata. See Structure for Iblock Module Tables |
value | Property value. Array type:
array( "VALUE" => value, "DESCRIPTION" => description, ); |
Returned value
Integer value.
See Also
Examples
<?
class CIBlockPropertyMyDateTime
{
//Checking without white-space characters
function GetLength($arProperty, $value)
{
return strlen(trim($value["VALUE"], "\n\r\t "));
}
}
?>
© «Bitrix24», 2001-2024