Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
status.php
1<?php
2namespace Bitrix\Im\Model;
3
5
37class StatusTable extends Entity\DataManager
38{
44 public static function getFilePath()
45 {
46 return __FILE__;
47 }
48
54 public static function getTableName()
55 {
56 return 'b_im_status';
57 }
58
64 public static function getMap()
65 {
66 return array(
67 'USER_ID' => array(
68 'data_type' => 'integer',
69 'primary' => true,
70 //'title' => Loc::getMessage('STATUS_ENTITY_USER_ID_FIELD'),
71 ),
72 'COLOR' => array(
73 'data_type' => 'string',
74 'validation' => array(__CLASS__, 'validateColor'),
75 //'title' => Loc::getMessage('STATUS_ENTITY_COLOR_FIELD'),
76 ),
77 'STATUS' => array(
78 'data_type' => 'string',
79 'validation' => array(__CLASS__, 'validateStatus'),
80 //'title' => Loc::getMessage('STATUS_ENTITY_STATUS_FIELD'),
81 'default_value' => 'online',
82 ),
83 'STATUS_TEXT' => array(
84 'data_type' => 'string',
85 'validation' => array(__CLASS__, 'validateStatusText'),
86 ),
87 'IDLE' => array(
88 'data_type' => 'datetime',
89 //'title' => Loc::getMessage('STATUS_ENTITY_IDLE_FIELD'),
90 ),
91 'DESKTOP_LAST_DATE' => array(
92 'data_type' => 'datetime',
93 //'title' => Loc::getMessage('STATUS_ENTITY_DESKTOP_LAST_DATE_FIELD'),
94 ),
95 'MOBILE_LAST_DATE' => array(
96 'data_type' => 'datetime',
97 //'title' => Loc::getMessage('STATUS_ENTITY_MOBILE_LAST_DATE_FIELD'),
98 ),
99 'EVENT_ID' => array(
100 'data_type' => 'integer',
101 //'title' => Loc::getMessage('STATUS_ENTITY_EVENT_ID_FIELD'),
102 ),
103 'EVENT_UNTIL_DATE' => array(
104 'data_type' => 'datetime',
105 //'title' => Loc::getMessage('STATUS_ENTITY_EVENT_UNTIL_DATE_FIELD'),
106 ),
107 'USER' => array(
108 'data_type' => 'Bitrix\Main\User',
109 'reference' => array('=this.USER_ID' => 'ref.ID'),
110 ),
111 );
112 }
118 public static function validateStatus()
119 {
120 return array(
121 new Entity\Validator\Length(null, 50),
122 );
123 }
129 public static function validateStatusText()
130 {
131 return array(
132 new Entity\Validator\Length(null, 255),
133 );
134 }
135
136 public static function validateColor()
137 {
138 return array(
139 new Entity\Validator\Length(null, 255),
140 );
141 }
142}