Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
bottoken.php
1<?php
2namespace Bitrix\Im\Model;
3
5
35class BotTokenTable extends Entity\DataManager
36{
42 public static function getTableName()
43 {
44 return 'b_im_bot_token';
45 }
46
52 public static function getMap()
53 {
54 return array(
55 'ID' => array(
56 'data_type' => 'integer',
57 'primary' => true,
58 'autocomplete' => true,
59 //'title' => Loc::getMessage('BOT_TOKEN_ENTITY_ID_FIELD'),
60 ),
61 'TOKEN' => array(
62 'data_type' => 'string',
63 'validation' => array(__CLASS__, 'validateToken'),
64 //'title' => Loc::getMessage('BOT_TOKEN_ENTITY_TOKEN_FIELD'),
65 ),
66 'DATE_CREATE' => array(
67 'data_type' => 'datetime',
68 'required' => true,
69 //'title' => Loc::getMessage('BOT_TOKEN_ENTITY_DATE_CREATE_FIELD'),
70 'default_value' => array(__CLASS__, 'getCurrentDate'),
71 ),
72 'DATE_EXPIRE' => array(
73 'data_type' => 'datetime',
74 //'title' => Loc::getMessage('BOT_TOKEN_ENTITY_DATE_EXPIRE_FIELD'),
75 ),
76 'BOT_ID' => array(
77 'data_type' => 'integer',
78 //'title' => Loc::getMessage('BOT_TOKEN_ENTITY_BOT_ID_FIELD'),
79 ),
80 'DIALOG_ID' => array(
81 'data_type' => 'string',
82 'required' => true,
83 'validation' => array(__CLASS__, 'validateDialogId'),
84 //'title' => Loc::getMessage('BOT_TOKEN_ENTITY_DIALOG_ID_FIELD'),
85 ),
86 );
87 }
88
94 public static function validateToken()
95 {
96 return array(
97 new Entity\Validator\Length(null, 32),
98 );
99 }
100
106 public static function validateDialogId()
107 {
108 return array(
109 new Entity\Validator\Length(null, 255),
110 );
111 }
112
118 public static function getCurrentDate()
119 {
120 return new \Bitrix\Main\Type\DateTime();
121 }
122}