1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
contact.php
См. документацию.
1<?php
2namespace Bitrix\Socialservices;
3
4use Bitrix\Main;
5use Bitrix\Main\Localization\Loc;
6use Bitrix\Main\Entity;
7use Bitrix\Main\Type\DateTime;
8
9Loc::loadMessages(__FILE__);
10
42
43class ContactTable extends Main\Entity\DataManager
44{
45 const NOTIFY = 'Y';
46 const DONT_NOTIFY = 'N';
47
50
52 const POSSIBLE_RESET_TIME = 2592000; // 86400 * 30
54
55 protected static $notifyStack = array();
56
62 public static function getTableName()
63 {
64 return 'b_socialservices_contact';
65 }
66
72 public static function getMap()
73 {
74 return array(
75 'ID' => array(
76 'data_type' => 'integer',
77 'primary' => true,
78 'autocomplete' => true,
79 ),
80 'TIMESTAMP_X' => array(
81 'data_type' => 'datetime',
82 ),
83 'USER_ID' => array(
84 'data_type' => 'integer',
85 'required' => true,
86 ),
87 'CONTACT_USER_ID' => array(
88 'data_type' => 'integer',
89 ),
90 'CONTACT_XML_ID' => array(
91 'data_type' => 'integer',
92 ),
93 'CONTACT_NAME' => array(
94 'data_type' => 'string',
95 ),
96 'CONTACT_LAST_NAME' => array(
97 'data_type' => 'string',
98 ),
99 'CONTACT_PHOTO' => array(
100 'data_type' => 'string',
101 ),
102 'LAST_AUTHORIZE' => array(
103 'data_type' => 'datetime',
104 ),
105 'NOTIFY' => array(
106 'data_type' => 'boolean',
107 'values' => array(static::DONT_NOTIFY, static::NOTIFY),
108 ),
109 'USER' => array(
110 'data_type' => 'Bitrix\Main\UserTable',
111 'reference' => array('=this.USER_ID' => 'ref.ID'),
112 ),
113 'CONTACT_USER' => array(
114 'data_type' => 'Bitrix\Main\UserTable',
115 'reference' => array('=this.CONTACT_USER_ID' => 'ref.ID'),
116 ),
117 );
118 }
119
120 public static function onBeforeUpdate(Entity\Event $event)
121 {
122 $result = new Entity\EventResult();
123 $data = $event->getParameter("fields");
124
125 if(!isset($data['TIMESTAMP_X']))
126 {
127 $data['TIMESTAMP_X'] = new DateTime();
128 $result->modifyFields($data);
129 }
130 }
131
132 public static function getConnectId($connect)
133 {
134 return $connect["CONNECT_TYPE"].$connect["CONTACT_PROFILE_ID"];
135 }
136}
Определения event.php:5
const POSSIBLE_RESET_TIME
Определения contact.php:52
const POSSIBLE_LAST_AUTHORIZE_LIMIT
Определения contact.php:51
static onBeforeUpdate(Entity\Event $event)
Определения contact.php:120
static getMap()
Определения contact.php:72
static getConnectId($connect)
Определения contact.php:132
const DONT_NOTIFY
Определения contact.php:46
const NOTIFY_CONTACT_COUNT
Определения contact.php:48
static $notifyStack
Определения contact.php:55
const POSSIBLE_RESET_TIME_KEY
Определения contact.php:53
const NOTIFY_POSSIBLE_COUNT
Определения contact.php:49
static getTableName()
Определения contact.php:62
$data['IS_AVAILABLE']
Определения .description.php:13
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
$result
Определения get_property_values.php:14
Определения ufield.php:9
$event
Определения prolog_after.php:141