Documentation

generateMnemonicCode

?string
public function \CIBlockElement::generateMnemonicCode(
 string $name,
 int $iblockId,
 array $options = []
);

Non-static method for generating a symbolic code. For this function to work, you need to disable the option Use external translation engine in iblock settings.

Returned value:

  • null - in case of errors
  • string - string with symbolic code

Function parameters

Parameter Description
$name Non-empty name string for which to generate the symbolic code. Type: string, mandatory/required.
$iblockId Iblock ID. Type: integer (int), mandatory/required.
$options redefined transliteration settings. Type: array, optional in general case.

Parameter can contain the following keys (if missing, parameters are sourced from iblock settings):

  • MAX_LEN - maximum length of received code, type: integer (int)
  • TRANS_CASE - case formatting, type: string. Possible values:
    • L - lower case format
    • U - upper case format
    • empty string - don't change the case
  • TRANS_SPACE - symbol, used for spacebar replacement, type: string, single symbol
  • TRANS_OTHER - symbol, used for replacement of other symbols, restricted for use in symbolic codes, type: string, single symbol
  • TRANS_EAT - delete iterations, type: sting, values: Y/N
  • LANGUAGE_ID - language code, source to be transliterated, additional key.

© «Bitrix24», 2001-2024
Up