Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
virustable.php
1<?php
2
3namespace Bitrix\Security;
4
6
23class VirusTable extends \Bitrix\Main\Entity\DataManager
24{
25 public static function getTableName()
26 {
27 return 'b_sec_virus';
28 }
29
30 public static function getConnectionName()
31 {
32 $connectionName = \Bitrix\Main\Session\Handlers\Table\UserSessionTable::CONNECTION_NAME;
33
34 $pool = \Bitrix\Main\Application::getInstance()->getConnectionPool();
35 $isConnectionExists = $pool->getConnection($connectionName) !== null;
36 if (!$isConnectionExists)
37 {
38 $pool->cloneConnection(
39 $pool::DEFAULT_CONNECTION_NAME,
40 $connectionName
41 );
42 }
43
44 return $connectionName;
45 }
46
47 public static function getMap()
48 {
49 return [
50 (new \Bitrix\Main\Entity\StringField('ID'))
51 ->configurePrimary()
52 ->configureSize(32),
53 (new \Bitrix\Main\Entity\DatetimeField('TIMESTAMP_X'))
54 ->configureNullable(),
55 (new \Bitrix\Main\Entity\StringField('SITE_ID'))
56 ->configureSize(2)
57 ->configureNullable(),
58 (new \Bitrix\Main\Entity\EnumField('SENT'))
59 ->configureValues(['Y', 'N'])
60 ->configureDefaultValue('N'),
61 (new \Bitrix\Main\Entity\TextField('INFO'))
62 ->configureLong(),
63 ];
64 }
65
66 public static function getCollectionClass()
67 {
68 return Viruss::class;
69 }
70
71 public static function getObjectClass()
72 {
73 return Virus::class;
74 }
75
76 public static function deleteList(array $filter)
77 {
78 $entity = static::getEntity();
79 $connection = $entity->getConnection();
80
81 $where = Query::buildFilterSql($entity, $filter);
82 $where = $where ? 'WHERE ' . $where : '';
83
84 $sql = sprintf(
85 'DELETE FROM %s %s',
86 $connection->getSqlHelper()->quote($entity->getDbTableName()),
87 $where
88 );
89
90 $res = $connection->query($sql);
91
92 return $res;
93 }
94
95}
96
97class Viruss extends EO_Virus_Collection
98{
99}
100
101class Virus extends EO_Virus
102{
103}
static deleteList(array $filter)