Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
currencylang.php
1<?php
2namespace Bitrix\Currency;
3
6Loc::loadMessages(__FILE__);
7
47class CurrencyLangTable extends Main\Entity\DataManager
48{
54 public static function getTableName()
55 {
56 return 'b_catalog_currency_lang';
57 }
58
64 public static function getMap()
65 {
66 return array(
67 'CURRENCY' => new Main\Entity\StringField('CURRENCY', array(
68 'primary' => true,
69 'validation' => array(__CLASS__, 'validateCurrency'),
70 'title' => Loc::getMessage('CURRENCY_LANG_ENTITY_CURRENCY_FIELD')
71 )),
72 'LID' => new Main\Entity\StringField('LID', array(
73 'primary' => true,
74 'validation' => array(__CLASS__, 'validateLid'),
75 'title' => Loc::getMessage('CURRENCY_LANG_ENTITY_LID_FIELD'),
76 )),
77 'FORMAT_STRING' => new Main\Entity\StringField('FORMAT_STRING', array(
78 'required' => true,
79 'validation' => array(__CLASS__, 'validateFormatString'),
80 'title' => Loc::getMessage('CURRENCY_LANG_ENTITY_FORMAT_STRING_FIELD')
81 )),
82 'FULL_NAME' => new Main\Entity\StringField('FULL_NAME', array(
83 'validation' => array(__CLASS__, 'validateFullName'),
84 'title' => Loc::getMessage('CURRENCY_LANG_ENTITY_FULL_NAME_FIELD')
85 )),
86 'DEC_POINT' => new Main\Entity\StringField('DEC_POINT', array(
87 'default_value' => '.',
88 'validation' => array(__CLASS__, 'validateDecPoint'),
89 'title' => Loc::getMessage('CURRENCY_LANG_ENTITY_DEC_POINT_FIELD')
90 )),
91 'THOUSANDS_SEP' => new Main\Entity\StringField('THOUSANDS_SEP', array(
92 'default_value' => ' ',
93 'validation' => array(__CLASS__, 'validateThousandsSep'),
94 'title' => Loc::getMessage('CURRENCY_LANG_ENTITY_THOUSANDS_SEP_FIELD')
95 )),
96 'DECIMALS' => new Main\Entity\IntegerField('DECIMALS', array(
97 'default_value' => 2,
98 'title' => Loc::getMessage('CURRENCY_LANG_ENTITY_DECIMALS_FIELD')
99 )),
100 'THOUSANDS_VARIANT' => new Main\Entity\StringField('THOUSANDS_VARIANT', array(
101 'validation' => array(__CLASS__, 'validateThousandsVariant'),
102 'title' => Loc::getMessage('CURRENCY_LANG_ENTITY_THOUSANDS_VARIANT_FIELD')
103 )),
104 'HIDE_ZERO' => new Main\Entity\BooleanField('HIDE_ZERO', array(
105 'values' => array('N', 'Y'),
106 'default_value' => 'N',
107 'title' => Loc::getMessage('CURRENCY_LANG_ENTITY_HIDE_ZERO_FIELD')
108 )),
109 'CREATED_BY' => new Main\Entity\IntegerField('CREATED_BY', array(
110 'title' => Loc::getMessage('CURRENCY_LANG_ENTITY_CREATED_BY_FIELD')
111 )),
112 'DATE_CREATE' => new Main\Entity\DatetimeField('DATE_CREATE', array(
113 'default_value' => function(){ return new Main\Type\DateTime(); },
114 'title' => Loc::getMessage('CURRENCY_LANG_ENTITY_DATE_CREATE_FIELD')
115 )),
116 'MODIFIED_BY' => new Main\Entity\IntegerField('MODIFIED_BY', array(
117 'title' => Loc::getMessage('CURRENCY_LANG_ENTITY_MODIFIED_BY_FIELD')
118 )),
119 'TIMESTAMP_X' => new Main\Entity\DatetimeField('TIMESTAMP_X', array(
120 'required' => true,
121 'default_value' => function(){ return new Main\Type\DateTime(); },
122 'title' => Loc::getMessage('CURRENCY_LANG_ENTITY_TIMESTAMP_X_FIELD')
123 )),
124 'CREATED_BY_USER' => array(
125 'data_type' => 'Bitrix\Main\User',
126 'reference' => array('=this.CREATED_BY' => 'ref.ID'),
127 ),
128 'MODIFIED_BY_USER' => array(
129 'data_type' => 'Bitrix\Main\User',
130 'reference' => array('=this.MODIFIED_BY' => 'ref.ID'),
131 ),
132 'LANGUAGE' => array(
133 'data_type' => 'Bitrix\Main\Localization\Language',
134 'reference' => array('=this.LID' => 'ref.LID'),
135 ),
136 );
137 }
138
144 public static function validateCurrency()
145 {
146 return array(
147 new Main\Entity\Validator\Length(null, 3),
148 );
149 }
150
156 public static function validateLid()
157 {
158 return array(
159 new Main\Entity\Validator\Length(2, 2),
160 );
161 }
162
168 public static function validateFormatString()
169 {
170 return array(
171 new Main\Entity\Validator\Length(null, 50),
172 );
173 }
174
180 public static function validateFullName()
181 {
182 return array(
183 new Main\Entity\Validator\Length(null, 50),
184 );
185 }
186
192 public static function validateDecPoint()
193 {
194 return array(
195 new Main\Entity\Validator\Length(null, 16),
196 );
197 }
198
204 public static function validateThousandsSep()
205 {
206 return array(
207 new Main\Entity\Validator\Length(null, 16),
208 );
209 }
210
216 public static function validateThousandsVariant()
217 {
218 return array(
219 new Main\Entity\Validator\Length(null, 1),
220 );
221 }
222}
static loadMessages($file)
Definition loc.php:64
static getMessage($code, $replace=null, $language=null)
Definition loc.php:29