Documentation

isUniqueElementCode

CIBlock::isUniqueElementCode(
 int $id
): bool;

Method verifies, if the unique element code requirement is enabled. Static method.

Call parameters

ParameterDescription
$id Iblock ID (int type).

Returned value

Returns true, when field settings Symbolic code (CODE) has a set parameter "Check uniqueness if the code is specified". Otherwise returns false.

Returns false for negative values. For non-existent iblocks, result depends on data returned by the method CIBlock::GetFieldsDefaults (field settings by default).

Example

<?
$id = 10; if (CIBlock::isUniqueElementCode($id)) { echo 'For iblock with code '.$id.' has enabled element code uniqueness check'; }
?>
© «Bitrix24», 2001-2024