Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
usertransacttable.php
1<?php
2
4
16
52{
58 public static function getTableName()
59 {
60 return 'b_sale_user_transact';
61 }
62
68 public static function getMap()
69 {
70 return [
71 'ID' =>
72 (new IntegerField('ID'))
73 ->configurePrimary(true)
74 ->configureAutocomplete(true)
75 ,
76 'USER_ID' =>
77 (new IntegerField('USER_ID'))
78 ->configureRequired(true)
79 ,
80 'TIMESTAMP_X' =>
81 (new DatetimeField('TIMESTAMP_X'))
82 ->configureDefaultValue(
83 static function()
84 {
85 return new DateTime();
86 }
87 )
88 ,
89 'TRANSACT_DATE' =>
90 (new DatetimeField('TRANSACT_DATE'))
91 ->configureRequired(true)
92 ,
93 'AMOUNT' =>
94 (new FloatField('AMOUNT'))
95 ->configureDefaultValue(0.0000)
96 ,
97 'CURRENCY' =>
98 (new StringField('CURRENCY'))
99 ->configureRequired(true)
100 ->addValidator(new LengthValidator(null, 3))
101 ,
102 'DEBIT' => (new BooleanField('DEBIT'))
103 ->configureValues('N', 'Y')
104 ->configureDefaultValue('N')
105 ,
106 'ORDER_ID' => (new IntegerField('ORDER_ID')),
107 'DESCRIPTION' =>
108 (new StringField('DESCRIPTION'))
109 ->configureRequired(true)
110 ->addValidator(new LengthValidator(null, 255))
111 ,
112 'NOTES' => (new TextField('NOTES')),
113 'PAYMENT_ID' => (new IntegerField('PAYMENT_ID')),
114 'EMPLOYEE_ID' => (new IntegerField('EMPLOYEE_ID')),
115 //
116 new Reference(
117 'ORDER',
118 OrderTable::class,
119 Join::on('this.ORDER_ID', 'ref.ID')
120 ),
121 new Reference(
122 'PAYMENT',
123 PaymentTable::class,
124 Join::on('this.PAYMENT_ID', 'ref.ID')
125 ),
126 ];
127 }
128}