Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
currency.php
1
<?php
2
namespace
Bitrix\Currency
;
3
4
use
Bitrix\Main
;
5
use
Bitrix\Main\Localization\Loc
;
6
7
Loc::loadMessages
(__FILE__);
8
46
class
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
{
172
return
CurrencyManager::currencyBaseRateAgent
();
173
}
174
}
Bitrix\Currency\CurrencyManager\currencyBaseRateAgent
static currencyBaseRateAgent()
Definition
currencymanager.php:470
Bitrix\Currency\CurrencyTable
Definition
currency.php:47
Bitrix\Currency\CurrencyTable\getMap
static getMap()
Definition
currency.php:63
Bitrix\Currency\CurrencyTable\currencyBaseRateAgent
static currencyBaseRateAgent()
Definition
currency.php:170
Bitrix\Currency\CurrencyTable\validateNumcode
static validateNumcode()
Definition
currency.php:157
Bitrix\Currency\CurrencyTable\validateCurrency
static validateCurrency()
Definition
currency.php:145
Bitrix\Currency\CurrencyTable\getTableName
static getTableName()
Definition
currency.php:53
Bitrix\Main\DB\SqlExpression
Definition
sqlexpression.php:19
Bitrix\Main\Localization\Loc
Definition
loc.php:11
Bitrix\Main\Localization\Loc\loadMessages
static loadMessages($file)
Definition
loc.php:64
Bitrix\Main\Localization\Loc\getMessage
static getMessage($code, $replace=null, $language=null)
Definition
loc.php:29
Bitrix\Main\ORM\Entity
Definition
entity.php:26
Bitrix\Main\ORM\Fields\DatetimeField
Definition
datetimefield.php:22
Bitrix\Main\ORM\Fields\FloatField
Definition
floatfield.php:20
Bitrix\Main\ORM\Fields\IntegerField
Definition
integerfield.php:20
Bitrix\Main\ORM\Fields\StringField
Definition
stringfield.php:20
Bitrix\Main\Type\DateTime
Definition
datetime.php:9
Bitrix\Currency
Bitrix\Main
modules
currency
lib
currency.php
Создано системой
1.10.0