Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
abuse.php
1<?php
2
4
7
8
26class AbuseTable extends Entity\DataManager
27{
28 const COUNTER_CODE_ABUSES = 'abuses';
29
35 public static function getTableName()
36 {
37 return 'b_sender_abuse';
38 }
39
45 public static function getMap()
46 {
47 return array(
48 new Entity\IntegerField('ID', array(
49 'primary' => true,
50 'autocomplete' => true
51 )),
52 new Entity\StringField('TEXT', array(
53 'required' => false
54 )),
55 new Entity\IntegerField('CONTACT_ID', array(
56 'required' => false
57 )),
58 new Entity\StringField('CONTACT_CODE', array(
59 'required' => true
60 )),
61 new Entity\IntegerField('CONTACT_TYPE_ID', array(
62 'required' => true,
63 )),
64 new Entity\DatetimeField('DATE_INSERT', array(
65 'required' => true,
66 'default_value' => new DateTime()
67 )),
68 );
69 }
70
77 public static function onAfterAdd(Entity\Event $event)
78 {
79 CounterTable::incrementByCode(self::COUNTER_CODE_ABUSES);
81 return new Entity\EventResult();
82 }
83
89 public static function getCountOfNew()
90 {
91 return CounterTable::getValueByCode(self::COUNTER_CODE_ABUSES);
92 }
93
99 public static function resetCountOfNew()
100 {
101 return CounterTable::resetValueByCode(self::COUNTER_CODE_ABUSES);
102 }
103}
static onAfterAdd(Entity\Event $event)
Definition abuse.php:77
static incrementByCode($code, $increment=1)
Definition counter.php:93
static incrementFieldValue($fieldName, $increment=1)