Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
userauthcodetable.php
1<?php
10
11use Bitrix\Main;
15
33{
34 use Data\Internal\DeleteByFilterTrait;
35
36 const TYPE_EMAIL = 'email';
37
38 public static function getTableName()
39 {
40 return 'b_user_auth_code';
41 }
42
43 public static function getMap()
44 {
45 return array(
46 new Fields\IntegerField("USER_ID", array(
47 'primary' => true,
48 'validation' => function()
49 {
50 return [
52 ];
53 }
54 )),
55
56 new Fields\StringField("CODE_TYPE", array(
57 'default_value' => self::TYPE_EMAIL,
58 'primary' => true,
59 )),
60
61 new Fields\SecretField("OTP_SECRET", array(
62 'crypto_enabled' => static::cryptoEnabled("OTP_SECRET"),
63 )),
64
65 new Fields\IntegerField("ATTEMPTS", array(
66 "default_value" => 0,
67 )),
68
69 new Fields\DatetimeField("DATE_SENT"),
70
71 new Fields\DatetimeField("DATE_RESENT"),
72
74 'USER',
75 Main\UserTable::class,
76 Join::on('this.USER_ID', 'ref.ID')
77 ))->configureJoinType('inner'),
78 );
79 }
80}