-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patholtable.php
More file actions
91 lines (88 loc) · 2.43 KB
/
oltable.php
File metadata and controls
91 lines (88 loc) · 2.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
<?
namespace ITHive\OpenLinesAdditional;
use \Bitrix\Main\Entity,
\Bitrix\Main\Localization\Loc;
IncludeModuleLangFile(__FILE__);
/**
* Class OlTable
*
* Fields:
* <ul>
* <li> ID int mandatory
* <li> USER_ID int optional
* <li> POST_ID int optional
* <li> COMMENT_ID int optional
* <li> MESSAGE string optional
* <li> CHAT_ID int optional
* <li> SYSTEM_TYPE string(20) optional
* <li> CREATED datetime optional
* </ul>
**/
class OlTable extends Entity\DataManager
{
/**
* Returns DB table name for entity.
*
* @return string
*/
public static function getTableName()
{
return 'ithive_ol';
}
/**
* Returns entity map definition.
*
* @return array
*/
public static function getMap()
{
return array(
'ID' => array(
'data_type' => 'integer',
'primary' => true,
'autocomplete' => true,
'title' => Loc::getMessage('OL_ENTITY_ID_FIELD'),
),
'USER_ID' => array(
'data_type' => 'integer',
'title' => Loc::getMessage('OL_ENTITY_USER_ID_FIELD'),
),
'POST_ID' => array(
'data_type' => 'integer',
'title' => Loc::getMessage('OL_ENTITY_POST_ID_FIELD'),
),
'COMMENT_ID' => array(
'data_type' => 'integer',
'title' => Loc::getMessage('OL_ENTITY_COMMENT_ID_FIELD'),
),
'CHAT_ID' => array(
'data_type' => 'integer',
'title' => Loc::getMessage('OL_ENTITY_CHAT_ID_FIELD'),
),
'OL_CHAT_ID' => array(
'data_type' => 'integer',
'title' => Loc::getMessage('OL_ENTITY_CHAT_ID_OL_FIELD'),
),
'SYSTEM_TYPE' => array(
'data_type' => 'string',
'validation' => array(__CLASS__, 'validateSystemType'),
'title' => Loc::getMessage('OL_ENTITY_SYSTEM_TYPE_FIELD'),
),
'CREATED' => array(
'data_type' => 'datetime',
'title' => Loc::getMessage('OL_ENTITY_CREATED_FIELD'),
),
);
}
/**
* Returns validators for SYSTEM_TYPE field.
*
* @return array
*/
public static function validateSystemType()
{
return array(
new Entity\Validator\Length(null, 20),
);
}
}