Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
ipruletable.php
1<?php
2
3namespace Bitrix\Security;
4
6
23class IPRuleTable extends \Bitrix\Main\Entity\DataManager
24{
25 public static function getTableName()
26 {
27 return 'b_sec_iprule';
28 }
29
30 public static function getMap()
31 {
32 return [
33 (new \Bitrix\Main\Entity\IntegerField('ID'))
34 ->configurePrimary()
35 ->configureAutocomplete(),
36 (new \Bitrix\Main\Entity\StringField('RULE_TYPE'))
37 ->configureSize(1)
38 ->configureDefaultValue('M'),
39 (new \Bitrix\Main\Entity\EnumField('ACTIVE'))
40 ->configureValues(['Y', 'N'])
41 ->configureDefaultValue('Y'),
42 (new \Bitrix\Main\Entity\EnumField('ADMIN_SECTION'))
43 ->configureValues(['Y', 'N'])
44 ->configureDefaultValue('Y'),
45 (new \Bitrix\Main\Entity\StringField('SITE_ID'))
46 ->configureSize(2)
47 ->configureNullable(),
48 (new \Bitrix\Main\Entity\IntegerField('SORT'))
49 ->configureDefaultValue(500),
50 (new \Bitrix\Main\Entity\DatetimeField('ACTIVE_FROM'))
51 ->configureNullable(),
52 (new \Bitrix\Main\Entity\IntegerField('ACTIVE_FROM_TIMESTAMP'))
53 ->configureNullable(),
54 (new \Bitrix\Main\Entity\DatetimeField('ACTIVE_TO'))
55 ->configureNullable(),
56 (new \Bitrix\Main\Entity\IntegerField('ACTIVE_TO_TIMESTAMP'))
57 ->configureNullable(),
58 (new \Bitrix\Main\Entity\StringField('NAME'))
59 ->configureSize(250)
60 ->configureNullable()
61 ];
62 }
63
64 public static function getCollectionClass()
65 {
66 return IPRules::class;
67 }
68
69 public static function getObjectClass()
70 {
71 return IPRule::class;
72 }
73
74 public static function deleteList(array $filter)
75 {
76 $entity = static::getEntity();
77 $connection = $entity->getConnection();
78
79 $where = Query::buildFilterSql($entity, $filter);
80 $where = $where ? 'WHERE ' . $where : '';
81
82 $sql = sprintf(
83 'DELETE FROM %s %s',
84 $connection->getSqlHelper()->quote($entity->getDbTableName()),
85 $where
86 );
87
88 $res = $connection->query($sql);
89
90 return $res;
91 }
92
93}
94
95class IPRules extends EO_IPRule_Collection
96{
97}
98
99class IPRule extends EO_IPRule
100{
101}
static deleteList(array $filter)