Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
currencyrate.php
1<?php
2namespace Bitrix\Currency;
3
6
7Loc::loadMessages(__FILE__);
8
43class CurrencyRateTable extends Main\Entity\DataManager
44{
50 public static function getTableName()
51 {
52 return 'b_catalog_currency_rate';
53 }
54
60 public static function getMap()
61 {
62 return array(
63 'ID' => new Main\Entity\IntegerField('ID', array(
64 'primary' => true,
65 'autocomplete' => true,
66 'title' => Loc::getMessage('CURRENCY_RATE_ENTITY_ID_FIELD')
67 )),
68 'CURRENCY' => new Main\Entity\StringField('CURRENCY', array(
69 'primary' => true,
70 'validation' => array(__CLASS__, 'validateCurrency'),
71 'title' => Loc::getMessage('CURRENCY_RATE_ENTITY_CURRENCY_FIELD')
72 )),
73 'BASE_CURRENCY' => new Main\Entity\StringField('BASE_CURRENCY', array(
74 'primary' => true,
75 'title' => Loc::getMessage('CURRENCY_RATE_ENTITY_BASE_CURRENCY_FIELD')
76 )),
77 'DATE_RATE' => new Main\Entity\DateField('DATE_RATE', array(
78 'primary' => true,
79 'title' => Loc::getMessage('CURRENCY_RATE_ENTITY_DATE_RATE_FIELD')
80 )),
81 'RATE_CNT' => new Main\Entity\IntegerField('RATE_CNT', array(
82 'title' => Loc::getMessage('CURRENCY_RATE_ENTITY_RATE_CNT_FIELD')
83 )),
84 'RATE' => new Main\Entity\FloatField('RATE', array(
85 'required' => true,
86 'title' => Loc::getMessage('CURRENCY_RATE_ENTITY_RATE_FIELD')
87 )),
88 'CREATED_BY' => new Main\Entity\IntegerField('CREATED_BY', array(
89 'title' => Loc::getMessage('CURRENCY_RATE_ENTITY_CREATED_BY_FIELD')
90 )),
91 'DATE_CREATE' => new Main\Entity\DatetimeField('DATE_CREATE', array(
92 'default_value' => function(){ return new Main\Type\DateTime(); },
93 'title' => Loc::getMessage('CURRENCY_RATE_ENTITY_DATE_CREATE_FIELD')
94 )),
95 'MODIFIED_BY' => new Main\Entity\IntegerField('MODIFIED_BY', array(
96 'title' => Loc::getMessage('CURRENCY_RATE_ENTITY_MODIFIED_BY_FIELD')
97 )),
98 'TIMESTAMP_X' => new Main\Entity\DatetimeField('TIMESTAMP_X', array(
99 'required' => true,
100 'default_value' => function(){ return new Main\Type\DateTime(); },
101 'title' => Loc::getMessage('CURRENCY_RATE_ENTITY_TIMESTAMP_X_FIELD')
102 )),
103 'CREATED_BY_USER' => new Main\Entity\ReferenceField(
104 'CREATED_BY_USER',
105 'Bitrix\Main\User',
106 array('=this.CREATED_BY' => 'ref.ID'),
107 array('join_type' => 'LEFT')
108 ),
109 'MODIFIED_BY_USER' => new Main\Entity\ReferenceField(
110 'MODIFIED_BY_USER',
111 'Bitrix\Main\User',
112 array('=this.MODIFIED_BY' => 'ref.ID'),
113 array('join_type' => 'LEFT')
114 )
115 );
116 }
117
123 public static function validateCurrency()
124 {
125 return array(
126 new Main\Entity\Validator\Length(null, 3),
127 );
128 }
129}
static loadMessages($file)
Definition loc.php:64
static getMessage($code, $replace=null, $language=null)
Definition loc.php:29