Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
userforum.php
1<?php
2namespace Bitrix\Forum;
3
8
25class UserForumTable extends Main\Entity\DataManager
26{
27 public static function getTableName(): string
28 {
29 return 'b_forum_user_forum';
30 }
31
32 public static function getMap()
33 {
34 return [
35 new Entity\IntegerField('ID', ['autocomplete' => true]),
36 new Entity\IntegerField('USER_ID', ['primary' => true]),
37 new Entity\IntegerField('FORUM_ID', ['primary' => true]),
38 new Entity\DatetimeField('LAST_VISIT'),
39 new Entity\DatetimeField('MAIN_LAST_VISIT'),
40 new Reference('USER', Main\UserTable::class, Join::on('this.USER_ID', 'ref.ID')),
41 new Reference('FORUM_USER', UserTable::class, Join::on('this.USER_ID', 'ref.USER_ID')),
42 ];
43 }
44
45 public static function deleteBatch(array $filter)
46 {
47 $tableName = static::getTableName();
48 $connection = Main\Application::getConnection();
49 $helper = $connection->getSqlHelper();
50
51 $where = [];
52 foreach ($filter as $key => $value)
53 {
54 $where[] = $helper->prepareAssignment($tableName, $key, $value);
55 }
56 $where = implode(' AND ', $where);
57
58 if($where)
59 {
60 $quotedTableName = $helper->quote($tableName);
61 $connection->queryExecute("DELETE FROM {$quotedTableName} WHERE {$where}");
62 }
63 }
64}
static deleteBatch(array $filter)
Definition userforum.php:45