Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
userprofilerecord.php
1
<?php
9
namespace
Bitrix\Main
;
10
11
use
Bitrix\Main\Entity
;
12
31
class
UserProfileRecordTable
extends
Entity\DataManager
32
{
33
public
static
function
getTableName
()
34
{
35
return
'b_user_profile_record'
;
36
}
37
38
public
static
function
getMap
()
39
{
40
return
array(
41
new
Entity
\
IntegerField
(
"ID"
, array(
42
'primary'
=>
true
,
43
'autocomplete'
=>
true
,
44
)),
45
new
Entity
\
IntegerField
(
"HISTORY_ID"
, array(
46
'required'
=>
true
,
47
)),
48
new
Entity
\
StringField
(
"FIELD"
),
49
new
Entity
\
TextField
(
'DATA'
, array(
50
'serialized'
=>
true
51
)),
52
new
Entity
\ReferenceField(
"HISTORY"
,
53
'\Bitrix\Main\UserProfileHistoryTable'
,
54
array(
'=this.HISTORY_ID'
=>
'ref.ID'
),
55
array(
'join_type'
=>
'INNER'
)
56
),
57
);
58
}
59
60
public
static
function
deleteByHistoryFilter
($where)
61
{
62
if
($where ==
''
)
63
{
64
throw
new
ArgumentException
(
"Deleting by empty filter is not allowed, use truncate (b_user_profile_record)."
,
"where"
);
65
}
66
67
$entity = static::getEntity();
68
$conn = $entity->getConnection();
69
70
$conn->query(
"
71
DELETE R FROM b_user_profile_record R
72
WHERE R.HISTORY_ID IN(
73
SELECT ID FROM b_user_profile_history
74
{$where}
75
)"
76
);
77
78
$entity->cleanCache();
79
}
80
}
Bitrix\Main\ArgumentException
Definition
exception.php:34
Bitrix\Main\ORM\Entity
Definition
entity.php:26
Bitrix\Main\ORM\Fields\IntegerField
Definition
integerfield.php:20
Bitrix\Main\ORM\Fields\StringField
Definition
stringfield.php:20
Bitrix\Main\ORM\Fields\TextField
Definition
textfield.php:20
Bitrix\Main\UserProfileRecordTable
Definition
userprofilerecord.php:32
Bitrix\Main\UserProfileRecordTable\getMap
static getMap()
Definition
userprofilerecord.php:38
Bitrix\Main\UserProfileRecordTable\deleteByHistoryFilter
static deleteByHistoryFilter($where)
Definition
userprofilerecord.php:60
Bitrix\Main\UserProfileRecordTable\getTableName
static getTableName()
Definition
userprofilerecord.php:33
Bitrix\Main
modules
main
lib
userprofilerecord.php
Создано системой
1.10.0