Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
agreement.php
1<?php
2
4
7
8
26class AgreementTable extends Entity\DataManager
27{
33 public static function getTableName()
34 {
35 return 'b_sender_agreement';
36 }
37
43 public static function getMap()
44 {
45 return array(
46 new Entity\IntegerField('ID', array(
47 'primary' => true,
48 'autocomplete' => true
49 )),
50 new Entity\IntegerField('USER_ID', array(
51 'required' => true
52 )),
53 new Entity\StringField('NAME', array(
54 'validation' => function ()
55 {
56 return array(
57 new Entity\Validator\Length(null, 100),
58 );
59 }
60 )),
61 new Entity\StringField('EMAIL', array(
62 'required' => false,
63 'validation' => function ()
64 {
65 return array(
66 new Entity\Validator\Length(null, 255),
67 );
68 }
69 )),
70 new Entity\DatetimeField('DATE', array(
71 'required' => true,
72 'default_value' => new DateTime()
73 )),
74 new Entity\StringField('IP_ADDRESS', array(
75 'required' => true,
76 'validation' => function ()
77 {
78 return array(
79 new Entity\Validator\Length(null, 39),
80 );
81 }
82 )),
83 );
84 }
85}