1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
userrelations.php
См. документацию.
1<?php
8namespace Bitrix\Socialnetwork;
9
10use Bitrix\Main\Entity;
11
28class UserRelationsTable extends Entity\DataManager
29{
31 public const RELATION_FRIEND = 'F';
32
34 public const RELATION_REQUEST = 'Z';
35
37 public const RELATION_BAN = 'B';
38
39 public const INITIATED_BY_FIRST = 'F';
40 public const INITIATED_BY_SECOND = 'S';
41
42 public static function getFilePath()
43 {
44 return __FILE__;
45 }
46
47 public static function getTableName()
48 {
49 return 'b_sonet_user_relations';
50 }
51
52 public static function getMap()
53 {
54 return array(
55 'ID' => array(
56 'data_type' => 'integer',
57 'primary' => true,
58 'autocomplete' => true,
59 ),
60 'FIRST_USER_ID' => array(
61 'data_type' => 'integer',
62 ),
63 'SECOND_USER_ID' => array(
64 'data_type' => 'integer',
65 ),
66 'RELATION' => array(
67 'data_type' => 'enum',
68 'required' => true,
69 'values' => array(self::RELATION_FRIEND, self::RELATION_REQUEST, self::RELATION_BAN),
70 ),
71 'INITIATED_BY' => array(
72 'data_type' => 'enum',
73 'required' => true,
74 'values' => array(self::INITIATED_BY_FIRST, self::INITIATED_BY_SECOND)
75 ),
76 'DATE_CREATE' => array(
77 'data_type' => 'datetime',
78 ),
79 'DATE_UPDATE' => array(
80 'data_type' => 'datetime',
81 ),
82 'MESSAGE' => array(
83 'data_type' => 'text',
84 ),
85 'FIRST_USER' => array(
86 'data_type' => 'Bitrix\Main\UserTable',
87 'reference' => array('=this.FIRST_USER_ID' => 'ref.ID'),
88 ),
89 'SECOND_USER' => array(
90 'data_type' => 'Bitrix\Main\UserTable',
91 'reference' => array('=this.SECOND_USER_ID' => 'ref.ID'),
92 ),
93 );
94 }
95
96 public static function getUserFilter($operation, $field, $filter)
97 {
98 return array(
99 'LOGIC' => 'OR',
100 $operation.preg_replace('/^USER/', 'FIRST_USER', $field) => $filter,
101 $operation.preg_replace('/^USER/', 'SECOND_USER', $field) => $filter,
102 );
103 }
104}
static getUserFilter($operation, $field, $filter)
Определения userrelations.php:96
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
$filter
Определения iblock_catalog_list.php:54