Bitrix API

CodeGenerator

Table of Contents

Methods

__construct()  : mixed
CodeGenerator constructor.
generate()  : string|null
Generate code
getUniqueCheckCallback()  : Closure|null
getUniqueCheckFilter()  : array<string|int, mixed>
isCodeValid()  : bool
Returns true if validation specified for the code string field passes successfully
setUniqueCheckCallback()  : $this
Set additional callback to check uniqueness code
setUniqueCheckFilter()  : $this
Set an additional filter that will be taken into account when fetching data using $this->dataManager to check the uniqueness of the code
setUseOnlyUniqueCheckCallback()  : self
setUseOnlyUniqueCheckFilter()  : $this
If true, then when checking the uniqueness of the code, only the filter set in $uniqueCheckFilter will be taken into account.

Methods

__construct()

CodeGenerator constructor.

public __construct(string $dataManager, StringField $codeField) : mixed
Parameters
$dataManager : string
$codeField : StringField
Tags
throws
ArgumentException

generate()

Generate code

public generate([string|null $title = null ]) : string|null
Parameters
$title : string|null = null
Return values
string|null

getUniqueCheckCallback()

public getUniqueCheckCallback() : Closure|null
Return values
Closure|null

getUniqueCheckFilter()

public getUniqueCheckFilter() : array<string|int, mixed>
Return values
array<string|int, mixed>

isCodeValid()

Returns true if validation specified for the code string field passes successfully

public isCodeValid(string $code) : bool
Parameters
$code : string
Tags
throws
SystemException
Return values
bool

setUniqueCheckCallback()

Set additional callback to check uniqueness code

public setUniqueCheckCallback(Closure|null $uniqueCheckCallback) : $this
Parameters
$uniqueCheckCallback : Closure|null
Return values
$this

setUniqueCheckFilter()

Set an additional filter that will be taken into account when fetching data using $this->dataManager to check the uniqueness of the code

public setUniqueCheckFilter(array<string|int, mixed> $uniqueCheckFilter) : $this
Parameters
$uniqueCheckFilter : array<string|int, mixed>
Return values
$this

setUseOnlyUniqueCheckCallback()

public setUseOnlyUniqueCheckCallback(bool $isUse) : self
Parameters
$isUse : bool
Return values
self

setUseOnlyUniqueCheckFilter()

If true, then when checking the uniqueness of the code, only the filter set in $uniqueCheckFilter will be taken into account.

public setUseOnlyUniqueCheckFilter(bool $isUse) : $this

Default $uniqueCheckFilter = []

Parameters
$isUse : bool
Return values
$this

        
On this page

Search results