Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
usercounter.php
1<?php
2namespace Bitrix\Main;
3
5
22class UserCounterTable extends Entity\DataManager
23{
24 public static function getTableName()
25 {
26 return 'b_user_counter';
27 }
28
29 public static function getMap()
30 {
31 return array(
32 'USER_ID' => array(
33 'data_type' => 'integer',
34 'primary' => true
35 ),
36 'SITE_ID' => array(
37 'data_type' => 'string',
38 'validation' => array(__CLASS__, 'validateSiteId'),
39 'primary' => true
40 ),
41 'CODE' => array(
42 'data_type' => 'string',
43 'validation' => array(__CLASS__, 'validateCode'),
44 'primary' => true
45 ),
46 'TAG' => array(
47 'data_type' => 'string',
48 'validation' => array(__CLASS__, 'validateTag'),
49 ),
50 'PARAMS' => array(
51 'data_type' => 'text'
52 ),
53 'SENT' => array(
54 'data_type' => 'string',
55 'validation' => array(__CLASS__, 'validateSent'),
56 ),
57 'CNT' => array(
58 'data_type' => 'integer'
59 ),
60 'LAST_DATE' => array(
61 'data_type' => 'datetime'
62 ),
63 'TIMESTAMP_X' => array(
64 'data_type' => 'datetime'
65 ),
66 'USER' => array(
67 'data_type' => 'Bitrix\Main\UserTable',
68 'reference' => array('=this.USER_ID' => 'ref.ID')
69 ),
70 );
71 }
72
73 public static function validateProviderId()
74 {
75 return array(
76 new Entity\Validator\Length(null, 50),
77 );
78 }
79
80 public static function validateSiteId()
81 {
82 return array(
83 new Entity\Validator\Length(null, 2),
84 );
85 }
86
87 public static function validateCode()
88 {
89 return array(
90 new Entity\Validator\Length(null, 50),
91 );
92 }
93
94 public static function validateSent()
95 {
96 return array(
97 new Entity\Validator\Length(null, 1),
98 );
99 }
100
101 public static function validateTag()
102 {
103 return array(
104 new Entity\Validator\Length(null, 255),
105 );
106 }
107
108 public static function validateAccessCode()
109 {
110 return array(
111 new Entity\Validator\Length(null, 100),
112 );
113 }
114}