ILIAS
release_5-2 Revision v5.2.25-18-g3f80b828510
◀ ilDoc Overview
class.ilObjectCustomUserFieldHistory.php
Go to the documentation of this file.
1
<?
php
2
/* Copyright (c) 1998-2010 ILIAS open source, Extended GPL, see docs/LICENSE */
3
11
class
ilObjectCustomUserFieldHistory
12
{
13
private
$obj_id
= 0;
14
private
$user_id
= 0;
15
private
$update_user
= 0;
16
private
$editing_time
= null;
17
23
public
function
__construct
($a_obj_id, $a_user_id)
24
{
25
$this->obj_id = $a_obj_id;
26
$this->user_id = $a_user_id;
27
$this->
read
();
28
}
29
36
public
static
function
lookupEntriesByObjectId
($a_obj_id)
37
{
38
global
$ilDB
;
39
40
$query
=
'SELECT * FROM obj_user_data_hist '
.
41
'WHERE obj_id = '
.$ilDB->quote($a_obj_id,
'integer'
);
42
$res
= $ilDB->query(
$query
);
43
44
$users =
array
();
45
while
(
$row
=
$res
->fetchRow(
ilDBConstants::FETCHMODE_OBJECT
))
46
{
47
$users[
$row
->usr_id][
'update_user'
] =
$row
->update_user;
48
$users[
$row
->usr_id][
'editing_time'
] =
new
ilDateTime
(
$row
->editing_time,
IL_CAL_DATETIME
,
ilTimeZone::UTC
);
49
}
50
return
$users;
51
}
52
57
public
function
setUpdateUser
($a_id)
58
{
59
$this->update_user = $a_id;
60
}
61
66
public
function
getUpdateUser
()
67
{
68
return
$this->update_user
;
69
}
70
75
public
function
setEditingTime
(
ilDateTime
$dt)
76
{
77
$this->editing_time = $dt;
78
}
79
84
public
function
getEditingTime
()
85
{
86
return
$this->editing_time
;
87
}
88
92
public
function
save
()
93
{
94
global
$ilDB
;
95
96
$this->
delete
();
97
98
$query
=
'INSERT INTO obj_user_data_hist (obj_id, usr_id, update_user, editing_time) '
.
99
'VALUES( '
.
100
$ilDB->quote($this->obj_id,
'integer'
).
', '
.
101
$ilDB->quote($this->user_id,
'integer'
).
', '
.
102
$ilDB->quote($this->
getUpdateUser
(),
'integer'
).
', '
.
103
$ilDB->quote($this->
getEditingTime
()->
get
(
IL_CAL_DATETIME
,
''
,
ilTimeZone::UTC
)).
' '
.
104
')'
;
105
$ilDB->manipulate(
$query
);
106
}
107
111
public
function
delete
()
112
{
113
global
$ilDB
;
114
115
$query
=
'DELETE FROM obj_user_data_hist '
.
116
'WHERE obj_id = '
.$ilDB->quote($this->obj_id,
'integer'
).
' '
.
117
'AND usr_id = '
.$ilDB->quote($this->user_id,
'integer'
);
118
$ilDB->manipulate(
$query
);
119
}
120
125
protected
function
read
()
126
{
127
global
$ilDB
;
128
129
$query
=
'SELECT * FROM obj_user_data_hist '
.
130
'WHERE obj_id = '
.$ilDB->quote($this->obj_id,
'integer'
).
' '
.
131
'AND usr_id = '
.$ilDB->quote($this->user_id,
'integer'
);
132
$res
= $ilDB->query(
$query
);
133
while
(
$row
=
$res
->fetchRow(
ilDBConstants::FETCHMODE_OBJECT
))
134
{
135
$this->
setEditingTime
(
new
ilDateTime
(
$row
->editing_time,
IL_CAL_DATETIME
,
ilTimeZone::UTC
));
136
$this->
setUpdateUser
(
$row
->update_user);
137
}
138
}
139
}
140
141
?>
IL_CAL_DATETIME
const IL_CAL_DATETIME
Definition:
class.ilDateTime.php:9
$res
$res
Definition:
examplelayouts.sql.php:25
ilTimeZone\UTC
const UTC
Definition:
class.ilTimeZone.php:45
$query
$query
Definition:
examplelayouts.sql.php:24
ilObjectCustomUserFieldHistory
Editing history for object custom user fields.
Definition:
class.ilObjectCustomUserFieldHistory.php:11
ilObjectCustomUserFieldHistory\setEditingTime
setEditingTime(ilDateTime $dt)
Set editing time.
Definition:
class.ilObjectCustomUserFieldHistory.php:75
ilObjectCustomUserFieldHistory\read
read()
read entry type $ilDB
Definition:
class.ilObjectCustomUserFieldHistory.php:125
ilObjectCustomUserFieldHistory\save
save()
Save entry.
Definition:
class.ilObjectCustomUserFieldHistory.php:92
ilObjectCustomUserFieldHistory\getEditingTime
getEditingTime()
Get editing time.
Definition:
class.ilObjectCustomUserFieldHistory.php:84
ilObjectCustomUserFieldHistory\$obj_id
$obj_id
Definition:
class.ilObjectCustomUserFieldHistory.php:13
ilObjectCustomUserFieldHistory\setUpdateUser
setUpdateUser($a_id)
Set update user.
Definition:
class.ilObjectCustomUserFieldHistory.php:57
ilObjectCustomUserFieldHistory\__construct
__construct($a_obj_id, $a_user_id)
Constructor.
Definition:
class.ilObjectCustomUserFieldHistory.php:23
ilDateTime
Date and time handling
Definition:
class.ilDateTime.php:32
ilObjectCustomUserFieldHistory\$user_id
$user_id
Definition:
class.ilObjectCustomUserFieldHistory.php:14
array
Create styles array
The data for the language used.
Definition:
40duplicateStyle.php:19
$ilDB
global $ilDB
Definition:
storeScorm2004.php:16
ilObjectCustomUserFieldHistory\$update_user
$update_user
Definition:
class.ilObjectCustomUserFieldHistory.php:15
php
ilDBConstants\FETCHMODE_OBJECT
const FETCHMODE_OBJECT
Definition:
class.ilDBConstants.php:13
$row
$row
Definition:
10autofilter-selection-1.php:74
ilObjectCustomUserFieldHistory\getUpdateUser
getUpdateUser()
get update user
Definition:
class.ilObjectCustomUserFieldHistory.php:66
ilObjectCustomUserFieldHistory\lookupEntriesByObjectId
static lookupEntriesByObjectId($a_obj_id)
Get entries by obj_id type $ilDB.
Definition:
class.ilObjectCustomUserFieldHistory.php:36
ilObjectCustomUserFieldHistory\$editing_time
$editing_time
Definition:
class.ilObjectCustomUserFieldHistory.php:16
Services
Membership
classes
class.ilObjectCustomUserFieldHistory.php
Generated on Fri Jan 24 2025 19:01:11 for ILIAS by
1.8.13 (using
Doxyfile
)