Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
currency.php
1<?php
2namespace Bitrix\Currency;
3
6
7Loc::loadMessages(__FILE__);
8
46class CurrencyTable extends Main\Entity\DataManager
47{
53 public static function getTableName()
54 {
55 return 'b_catalog_currency';
56 }
57
63 public static function getMap()
64 {
65 return array(
66 'CURRENCY' => new Main\Entity\StringField('CURRENCY', array(
67 'primary' => true,
68 'validation' => array(__CLASS__, 'validateCurrency'),
69 'required' => true,
70 'title' => Loc::getMessage('CURRENCY_ENTITY_CURRENCY_FIELD')
71 )),
72 'AMOUNT_CNT' => new Main\Entity\IntegerField('AMOUNT_CNT', array(
73 'required' => true,
74 'title' => Loc::getMessage('CURRENCY_ENTITY_AMOUNT_CNT_FIELD'),
75 )),
76 'AMOUNT' => new Main\Entity\FloatField('AMOUNT', array(
77 'required' => true,
78 'title' => Loc::getMessage('CURRENCY_ENTITY_AMOUNT_FIELD')
79 )),
80 'SORT' => new Main\Entity\IntegerField('SORT', array(
81 'title' => Loc::getMessage('CURRENCY_ENTITY_SORT_FIELD')
82 )),
83 'DATE_UPDATE' => new Main\Entity\DatetimeField('DATE_UPDATE', array(
84 'required' => true,
85 'default_value' => function(){ return new Main\Type\DateTime(); },
86 'title' => Loc::getMessage('CURRENCY_ENTITY_DATE_UPDATE_FIELD')
87 )),
88 'NUMCODE' => new Main\Entity\StringField('NUMCODE', array(
89 'validation' => array(__CLASS__, 'validateNumcode'),
90 'title' => Loc::getMessage('CURRENCY_ENTITY_NUMCODE_FIELD')
91 )),
92 'BASE' => new Main\Entity\BooleanField('BASE', array(
93 'values' => array('N','Y'),
94 'default_value' => 'N',
95 'title' => Loc::getMessage('CURRENCY_ENTITY_BASE_FIELD')
96 )),
97 'CREATED_BY' => new Main\Entity\IntegerField('CREATED_BY', array(
98 'title' => Loc::getMessage('CURRENCY_ENTITY_CREATED_BY_FIELD')
99 )),
100 'DATE_CREATE' => new Main\Entity\DatetimeField('DATE_CREATE', array(
101 'default_value' => function(){ return new Main\Type\DateTime(); },
102 'title' => Loc::getMessage('CURRENCY_ENTITY_DATE_CREATE_FIELD')
103 )),
104 'MODIFIED_BY' => new Main\Entity\IntegerField('MODIFIED_BY', array(
105 'title' => Loc::getMessage('CURRENCY_ENTITY_MODIFIED_BY_FIELD')
106 )),
107 'CURRENT_BASE_RATE' => new Main\Entity\FloatField('CURRENT_BASE_RATE', array(
108 'title' => Loc::getMessage('CURRENCY_ENTITY_CURRENT_BASE_RATE_FIELD')
109 )),
110 'CREATED_BY_USER' => new Main\Entity\ReferenceField(
111 'CREATED_BY_USER',
112 'Bitrix\Main\User',
113 array('=this.CREATED_BY' => 'ref.ID'),
114 array('join_type' => 'LEFT')
115 ),
116 'MODIFIED_BY_USER' => new Main\Entity\ReferenceField(
117 'MODIFIED_BY_USER',
118 'Bitrix\Main\User',
119 array('=this.MODIFIED_BY' => 'ref.ID'),
120 array('join_type' => 'LEFT')
121 ),
122 'LANG_FORMAT' => new Main\Entity\ReferenceField(
123 'LANG_FORMAT',
124 'Bitrix\Currency\CurrencyLang',
125 array('=this.CURRENCY' => 'ref.CURRENCY'),
126 array('join_type' => 'LEFT')
127 ),
128 'CURRENT_LANG_FORMAT' => new Main\Entity\ReferenceField(
129 'CURRENT_LANG_FORMAT',
130 'Bitrix\Currency\CurrencyLang',
131 array(
132 '=this.CURRENCY' => 'ref.CURRENCY',
133 '=ref.LID' => new Main\DB\SqlExpression('?', LANGUAGE_ID)
134 ),
135 array('join_type' => 'LEFT')
136 )
137 );
138 }
139
145 public static function validateCurrency()
146 {
147 return array(
148 new Main\Entity\Validator\Length(null, 3),
149 );
150 }
151
157 public static function validateNumcode()
158 {
159 return array(
160 new Main\Entity\Validator\Length(null, 3),
161 );
162 }
163
170 public static function currencyBaseRateAgent()
171 {
173 }
174}
static loadMessages($file)
Definition loc.php:64
static getMessage($code, $replace=null, $language=null)
Definition loc.php:29