1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
subscribeaccess.php
См. документацию.
1
<?php
2
namespace
Bitrix\Catalog;
3
4
use Bitrix\Main\Entity,
5
Bitrix\Main\Type\DateTime,
6
Bitrix\Main\Application;
7
24
class
SubscribeAccessTable
extends
Entity\DataManager
25
{
26
const
TOKEN_LIFE_TIME
= 3600;
27
33
public
static
function
getTableName
()
34
{
35
return
'b_catalog_subscribe_access'
;
36
}
37
43
public
static
function
getMap
()
44
{
45
return
array
(
46
'ID'
=>
array
(
47
'data_type'
=>
'integer'
,
48
'primary'
=>
true
,
49
'autocomplete'
=>
true
,
50
),
51
'DATE_FROM'
=>
array
(
52
'data_type'
=>
'datetime'
,
53
'required'
=>
true
,
54
'default_value'
=> fn() =>
new
DateTime
(),
55
),
56
'USER_CONTACT'
=>
array
(
57
'data_type'
=>
'string'
,
58
'required'
=>
true
,
59
),
60
'SUBSCRIBE'
=>
array
(
61
'data_type'
=>
'Bitrix\Catalog\SubscribeTable'
,
62
'reference'
=>
array
(
'=this.USER_CONTACT'
=>
'ref.USER_CONTACT'
),
63
),
64
'TOKEN'
=>
array
(
65
'data_type'
=>
'string'
,
66
'required'
=>
true
,
67
'validation'
=>
array
(__CLASS__,
'validateToken'
),
68
),
69
);
70
}
71
77
public
static
function
validateToken
()
78
{
79
return
array
(
80
new
Entity
\
Validator
\Length(
null
, 6),
81
);
82
}
83
89
public
static
function
clearOldRows
()
90
{
91
$connection
= Application::getConnection();
92
$helper =
$connection
->getSqlHelper();
93
$connection
->queryExecute(
'delete from '
.$helper->quote(static::getTableName()).
' where '
94
.$helper->quote(
'DATE_FROM'
).
' < '
.$helper->addSecondsToDateTime(-(static::TOKEN_LIFE_TIME))
95
);
96
}
97
}
$connection
$connection
Определения
actionsdefinitions.php:38
Bitrix\Catalog\SubscribeAccessTable
Определения
subscribeaccess.php:25
Bitrix\Catalog\SubscribeAccessTable\getMap
static getMap()
Определения
subscribeaccess.php:43
Bitrix\Catalog\SubscribeAccessTable\TOKEN_LIFE_TIME
const TOKEN_LIFE_TIME
Определения
subscribeaccess.php:26
Bitrix\Catalog\SubscribeAccessTable\clearOldRows
static clearOldRows()
Определения
subscribeaccess.php:89
Bitrix\Catalog\SubscribeAccessTable\validateToken
static validateToken()
Определения
subscribeaccess.php:77
Bitrix\Catalog\SubscribeAccessTable\getTableName
static getTableName()
Определения
subscribeaccess.php:33
Bitrix\Main\ORM\Fields\Validators\Validator
Определения
validator.php:18
Bitrix\Main\Type\DateTime
Определения
datetime.php:9
array
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения
file_new.php:804
Bitrix\Main\Entity
Определения
ufield.php:9
bitrix
modules
catalog
lib
subscribeaccess.php
Создано системой
1.14.0