Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
paysystemservice.php
1<?php
9
10use Bitrix\Main;
12
13Loc::loadMessages(__FILE__);
14
31class PaySystemServiceTable extends Main\Entity\DataManager
32{
33 public static function getTableName()
34 {
35 return 'b_sale_pay_system';
36 }
37
38 public static function getMap()
39 {
40 return array(
41 'ID' => array(
42 'data_type' => 'integer',
43 'primary' => true,
44 'autocomplete' => true,
45 'title' => Loc::getMessage('PAY_SYSTEM_ENTITY_ID_FIELD'),
46 ),
47 'LID' => array(
48 'data_type' => 'string',
49 'validation' => array(__CLASS__, 'validateLid'),
50 'title' => Loc::getMessage('PAY_SYSTEM_ENTITY_LID_FIELD'),
51 ),
52 'CURRENCY' => array(
53 'data_type' => 'string',
54 'validation' => array(__CLASS__, 'validateCurrency'),
55 'title' => Loc::getMessage('PAY_SYSTEM_ENTITY_CURRENCY_FIELD'),
56 ),
57 'NAME' => array(
58 'data_type' => 'string',
59 'required' => true,
60 'validation' => array(__CLASS__, 'validateName'),
61 'title' => Loc::getMessage('PAY_SYSTEM_ENTITY_NAME_FIELD'),
62 ),
63 'ACTIVE' => array(
64 'data_type' => 'boolean',
65 'values' => array('N', 'Y'),
66 'title' => Loc::getMessage('PAY_SYSTEM_ENTITY_ACTIVE_FIELD'),
67 ),
68 'ALLOW_EDIT_PAYMENT' => array(
69 'data_type' => 'boolean',
70 'values' => array('N', 'Y'),
71 'title' => Loc::getMessage('PAY_SYSTEM_ENTITY_ALLOW_EDIT_PAYMENT_FIELD'),
72 ),
73 'SORT' => array(
74 'data_type' => 'integer',
75 'title' => Loc::getMessage('PAY_SYSTEM_ENTITY_SORT_FIELD'),
76 ),
77 'DESCRIPTION' => array(
78 'data_type' => 'string',
79 'validation' => array(__CLASS__, 'validateDescription'),
80 'title' => Loc::getMessage('PAY_SYSTEM_ENTITY_DESCRIPTION_FIELD'),
81 ),
82 'ACTION' => array(
83 'data_type' => 'Bitrix\Sale\Internals\PaySystemActionTable',
84 'reference' => array('=this.ID' => 'ref.PAY_SYSTEM_ID')
85 ),
86 );
87 }
88
94 public static function validateLid()
95 {
96 return array(
97 new Entity\Validator\Length(null, 2),
98 );
99 }
105 public static function validateCurrency()
106 {
107 return array(
108 new Entity\Validator\Length(null, 3),
109 );
110 }
116 public static function validateName()
117 {
118 return array(
119 new Entity\Validator\Length(null, 255),
120 );
121 }
127 public static function validateDescription()
128 {
129 return array(
130 new Entity\Validator\Length(null, 2000),
131 );
132 }
133
134 public static function getListWithInner(array $parameters = array())
135 {
136 if(isset($parameters['filter']))
137 {
138 $parameters['filter'] = array(
139 'LOGIC' => 'OR',
140 $parameters['filter'],
141 array(
142 'ID' => \Bitrix\Sale\PaySystem\Manager::getInnerPaySystemId()
143 )
144 );
145 }
146
147 return parent::getList($parameters);
148 }
149}
static loadMessages($file)
Definition loc.php:64
static getMessage($code, $replace=null, $language=null)
Definition loc.php:29
static getListWithInner(array $parameters=array())