Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
prefixnumbergenerator.php
1<?php
3
7
8Loc::loadMessages(__FILE__);
9
15{
16 protected $prefix;
17 const TEMPLATE_WORD_PREFIX = 'PREFIX';
18
20 public function setConfig($config)
21 {
22 $this->setFromArrayOrDefault('prefix', $config, '');
23 }
24
26 public function getConfig()
27 {
28 return ['prefix' => $this->prefix];
29 }
30
34 public static function getAvailableForType()
35 {
36 return 'DEFAULT';
37 }
38
40 public function parseTemplate($template)
41 {
42 return str_replace(static::getPatternFor(static::TEMPLATE_WORD_PREFIX), $this->prefix, $template);
43 }
44
46 public static function getTemplateWordsForParse()
47 {
48 return [static::getPatternFor(static::TEMPLATE_WORD_PREFIX)];
49 }
50
52 public static function getTemplateWordsSettings()
53 {
54 return [
55 static::getPatternFor(static::TEMPLATE_WORD_PREFIX) =>
56 Loc::getMessage('BITRIX_MAIN_NUMERATOR_GENERATOR_PREFIXNUMBERGENERATOR_WORD_PREFIX'),
57 ];
58 }
59
61 public static function getSettingsFields()
62 {
63 return [
64 [
65 'settingName' => 'prefix',
66 'type' => 'string',
67 'title' => static::getPrefixSettingsTitle(),
68 ],
69 ];
70 }
71
75 protected static function getPrefixSettingsTitle()
76 {
77 return Loc::getMessage('TITLE_BITRIX_MAIN_NUMERATOR_GENERATOR_PREFIXNUMBERGENERATOR_PREFIX');
78 }
79
81 public function validateConfig($config)
82 {
83 $result = new Result();
84 return $result;
85 }
86}
static loadMessages($file)
Definition loc.php:64
static getMessage($code, $replace=null, $language=null)
Definition loc.php:29
setFromArrayOrDefault($value, $config, $default=null, $type=null)