SequentNumberGenerator extends NumberGenerator implements Sequenceable, UserConfigurable
Class SequentNumberGenerator
Table of Contents
Interfaces
- Sequenceable
- Interface Sequenceable
- UserConfigurable
- Interface UserConfigurable - for generators that have configurations fields that can be set by users generators store their settings values in db
Constants
- DAY = 'day'
- ERROR_SEQUENCE_NOT_SET = 'ERROR_SEQUENCE_NOT_SET'
- MONTH = 'month'
- SYMBOL_END = '}'
- SYMBOL_START = '{'
- TEMPLATE_WORD_NUMBER = 'NUMBER'
- USER_DEFINED_SYMBOL_END = '}'
- USER_DEFINED_SYMBOL_START = '{USER_DEFINED:'
- YEAR = 'year'
Methods
- getAvailableForType() : string
- return type of numerator that this generator can work with
- getConfig() : array<string|int, mixed>
- getNextNumber() : mixed
- getSettingsFields() : array<string|int, mixed>
- getTemplateWordsForParse() : mixed
- return array of words that can be parsed by generator
- getTemplateWordsSettings() : mixed
- return array, where keys are words of generator and values are corresponding titles for showing to end user for each word e.g. {PREFIX} => 'prefix'
- getType() : string
- onGeneratorClassesCollect() : string
- in case of inheritance (adding new custom generator) you should register this function of your class as module Dependency for module 'main' and event NumberGeneratorFactory::EVENT_GENERATOR_CLASSES_COLLECT
- parseTemplate() : string
- replace specific symbol (that generator is responsible for) with some string by internal logic
- parseTemplateForPreview() : string
- Must not affect internal counters and keep storage value unchanged, by default - same logic as in parseTemplate
- setConfig() : mixed
- setNextNumber() : Result
- setNumberHash() : mixed
- validateConfig() : Result
Constants
DAY
public
mixed
DAY
= 'day'
ERROR_SEQUENCE_NOT_SET
public
mixed
ERROR_SEQUENCE_NOT_SET
= 'ERROR_SEQUENCE_NOT_SET'
MONTH
public
mixed
MONTH
= 'month'
SYMBOL_END
public
mixed
SYMBOL_END
= '}'
SYMBOL_START
public
mixed
SYMBOL_START
= '{'
TEMPLATE_WORD_NUMBER
public
mixed
TEMPLATE_WORD_NUMBER
= 'NUMBER'
USER_DEFINED_SYMBOL_END
public
mixed
USER_DEFINED_SYMBOL_END
= '}'
USER_DEFINED_SYMBOL_START
public
mixed
USER_DEFINED_SYMBOL_START
= '{USER_DEFINED:'
YEAR
public
mixed
YEAR
= 'year'
Methods
getAvailableForType()
return type of numerator that this generator can work with
public
static getAvailableForType() : string
Return values
stringgetConfig()
public
getConfig() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —of configuration fields and their values
getNextNumber()
public
getNextNumber(mixed $numeratorId) : mixed
Parameters
- $numeratorId : mixed
Tags
getSettingsFields()
public
static getSettingsFields() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —of configuration fields that can be edited by user
getTemplateWordsForParse()
return array of words that can be parsed by generator
public
static getTemplateWordsForParse() : mixed
Tags
getTemplateWordsSettings()
return array, where keys are words of generator and values are corresponding titles for showing to end user for each word e.g. {PREFIX} => 'prefix'
public
static getTemplateWordsSettings() : mixed
Tags
getType()
public
static getType() : string
Return values
stringonGeneratorClassesCollect()
in case of inheritance (adding new custom generator) you should register this function of your class as module Dependency for module 'main' and event NumberGeneratorFactory::EVENT_GENERATOR_CLASSES_COLLECT
public
static onGeneratorClassesCollect() : string
Tags
Return values
string —- static class name
parseTemplate()
replace specific symbol (that generator is responsible for) with some string by internal logic
public
parseTemplate(mixed $template) : string
Parameters
- $template : mixed
Tags
Return values
string —after parse
parseTemplateForPreview()
Must not affect internal counters and keep storage value unchanged, by default - same logic as in parseTemplate
public
parseTemplateForPreview(mixed $template) : string
Parameters
- $template : mixed
Tags
Return values
stringsetConfig()
public
setConfig(mixed $config) : mixed
Parameters
- $config : mixed
Tags
setNextNumber()
public
setNextNumber(mixed $numeratorId, mixed $newNumber, mixed $whereNumber) : Result
Parameters
- $numeratorId : mixed
- $newNumber : mixed
- $whereNumber : mixed
Return values
ResultsetNumberHash()
public
setNumberHash(mixed $numberHash) : mixed
Parameters
- $numberHash : mixed
Tags
validateConfig()
public
validateConfig(mixed $config) : Result
Parameters
- $config : mixed