ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilObjectCustomUserFieldHistory Class Reference

Editing history for object custom user fields. More...

+ Collaboration diagram for ilObjectCustomUserFieldHistory:

Public Member Functions

 __construct ($a_obj_id, $a_user_id)
 Constructor. More...
 
 setUpdateUser ($a_id)
 Set update user. More...
 
 getUpdateUser ()
 get update user More...
 
 setEditingTime (ilDateTime $dt)
 Set editing time. More...
 
 getEditingTime ()
 Get editing time. More...
 
 save ()
 Save entry. More...
 
 delete ()
 Delete one entry. More...
 

Static Public Member Functions

static lookupEntriesByObjectId ($a_obj_id)
 Get entries by obj_id type $ilDB. More...
 

Protected Member Functions

 read ()
 read entry type $ilDB More...
 

Private Attributes

 $obj_id = 0
 
 $user_id = 0
 
 $update_user = 0
 
 $editing_time = null
 

Detailed Description

Editing history for object custom user fields.

Author
Stefan Meyer smeye.nosp@m.r.il.nosp@m.ias@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

Definition at line 11 of file class.ilObjectCustomUserFieldHistory.php.

Constructor & Destructor Documentation

◆ __construct()

ilObjectCustomUserFieldHistory::__construct (   $a_obj_id,
  $a_user_id 
)

Constructor.

Parameters
type$a_obj_id
type$a_user_id

Definition at line 23 of file class.ilObjectCustomUserFieldHistory.php.

References read().

24  {
25  $this->obj_id = $a_obj_id;
26  $this->user_id = $a_user_id;
27  $this->read();
28  }
+ Here is the call graph for this function:

Member Function Documentation

◆ delete()

ilObjectCustomUserFieldHistory::delete ( )

Delete one entry.

Definition at line 114 of file class.ilObjectCustomUserFieldHistory.php.

References $DIC, $ilDB, and $query.

115  {
116  global $DIC;
117 
118  $ilDB = $DIC['ilDB'];
119 
120  $query = 'DELETE FROM obj_user_data_hist ' .
121  'WHERE obj_id = ' . $ilDB->quote($this->obj_id, 'integer') . ' ' .
122  'AND usr_id = ' . $ilDB->quote($this->user_id, 'integer');
123  $ilDB->manipulate($query);
124  }
global $DIC
Definition: saml.php:7
$query
global $ilDB

◆ getEditingTime()

ilObjectCustomUserFieldHistory::getEditingTime ( )

Get editing time.

Returns
ilDateTime

Definition at line 85 of file class.ilObjectCustomUserFieldHistory.php.

References $editing_time.

Referenced by save().

+ Here is the caller graph for this function:

◆ getUpdateUser()

ilObjectCustomUserFieldHistory::getUpdateUser ( )

get update user

Returns
type

Definition at line 67 of file class.ilObjectCustomUserFieldHistory.php.

References $update_user.

Referenced by save().

+ Here is the caller graph for this function:

◆ lookupEntriesByObjectId()

static ilObjectCustomUserFieldHistory::lookupEntriesByObjectId (   $a_obj_id)
static

Get entries by obj_id type $ilDB.

Parameters
type$a_obj_id
Returns

Definition at line 36 of file class.ilObjectCustomUserFieldHistory.php.

References $DIC, $ilDB, $query, $res, $row, $users, ilDBConstants\FETCHMODE_OBJECT, IL_CAL_DATETIME, and ilTimeZone\UTC.

Referenced by ilGroupParticipantsTableGUI\parse(), ilCourseParticipantsTableGUI\parse(), ilSubscriberTableGUI\readSubscriberData(), and ilWaitingListTableGUI\readUserData().

37  {
38  global $DIC;
39 
40  $ilDB = $DIC['ilDB'];
41 
42  $query = 'SELECT * FROM obj_user_data_hist ' .
43  'WHERE obj_id = ' . $ilDB->quote($a_obj_id, 'integer');
44  $res = $ilDB->query($query);
45 
46  $users = array();
47  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
48  $users[$row->usr_id]['update_user'] = $row->update_user;
49  $users[$row->usr_id]['editing_time'] = new ilDateTime($row->editing_time, IL_CAL_DATETIME, ilTimeZone::UTC);
50  }
51  return $users;
52  }
const IL_CAL_DATETIME
global $DIC
Definition: saml.php:7
foreach($_POST as $key=> $value) $res
Date and time handling
$query
$users
Definition: authpage.php:44
$row
global $ilDB
+ Here is the caller graph for this function:

◆ read()

ilObjectCustomUserFieldHistory::read ( )
protected

read entry type $ilDB

Definition at line 130 of file class.ilObjectCustomUserFieldHistory.php.

References $DIC, $ilDB, $query, $res, $row, ilDBConstants\FETCHMODE_OBJECT, IL_CAL_DATETIME, setEditingTime(), setUpdateUser(), and ilTimeZone\UTC.

Referenced by __construct().

131  {
132  global $DIC;
133 
134  $ilDB = $DIC['ilDB'];
135 
136  $query = 'SELECT * FROM obj_user_data_hist ' .
137  'WHERE obj_id = ' . $ilDB->quote($this->obj_id, 'integer') . ' ' .
138  'AND usr_id = ' . $ilDB->quote($this->user_id, 'integer');
139  $res = $ilDB->query($query);
140  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
141  $this->setEditingTime(new ilDateTime($row->editing_time, IL_CAL_DATETIME, ilTimeZone::UTC));
142  $this->setUpdateUser($row->update_user);
143  }
144  }
const IL_CAL_DATETIME
global $DIC
Definition: saml.php:7
setEditingTime(ilDateTime $dt)
Set editing time.
foreach($_POST as $key=> $value) $res
Date and time handling
$query
$row
global $ilDB
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ save()

ilObjectCustomUserFieldHistory::save ( )

Save entry.

Definition at line 93 of file class.ilObjectCustomUserFieldHistory.php.

References $DIC, $ilDB, $query, getEditingTime(), getUpdateUser(), IL_CAL_DATETIME, and ilTimeZone\UTC.

94  {
95  global $DIC;
96 
97  $ilDB = $DIC['ilDB'];
98 
99  $this->delete();
100 
101  $query = 'INSERT INTO obj_user_data_hist (obj_id, usr_id, update_user, editing_time) ' .
102  'VALUES( ' .
103  $ilDB->quote($this->obj_id, 'integer') . ', ' .
104  $ilDB->quote($this->user_id, 'integer') . ', ' .
105  $ilDB->quote($this->getUpdateUser(), 'integer') . ', ' .
106  $ilDB->quote($this->getEditingTime()->get(IL_CAL_DATETIME, '', ilTimeZone::UTC)) . ' ' .
107  ')';
108  $ilDB->manipulate($query);
109  }
const IL_CAL_DATETIME
global $DIC
Definition: saml.php:7
$query
global $ilDB
+ Here is the call graph for this function:

◆ setEditingTime()

ilObjectCustomUserFieldHistory::setEditingTime ( ilDateTime  $dt)

Set editing time.

Parameters
ilDateTime$dt

Definition at line 76 of file class.ilObjectCustomUserFieldHistory.php.

Referenced by read().

77  {
78  $this->editing_time = $dt;
79  }
+ Here is the caller graph for this function:

◆ setUpdateUser()

ilObjectCustomUserFieldHistory::setUpdateUser (   $a_id)

Set update user.

Parameters
int$a_id

Definition at line 58 of file class.ilObjectCustomUserFieldHistory.php.

Referenced by read(), and ilMemberAgreementGUI\save().

59  {
60  $this->update_user = $a_id;
61  }
+ Here is the caller graph for this function:

Field Documentation

◆ $editing_time

ilObjectCustomUserFieldHistory::$editing_time = null
private

Definition at line 16 of file class.ilObjectCustomUserFieldHistory.php.

Referenced by getEditingTime().

◆ $obj_id

ilObjectCustomUserFieldHistory::$obj_id = 0
private

Definition at line 13 of file class.ilObjectCustomUserFieldHistory.php.

◆ $update_user

ilObjectCustomUserFieldHistory::$update_user = 0
private

Definition at line 15 of file class.ilObjectCustomUserFieldHistory.php.

Referenced by getUpdateUser().

◆ $user_id

ilObjectCustomUserFieldHistory::$user_id = 0
private

Definition at line 14 of file class.ilObjectCustomUserFieldHistory.php.


The documentation for this class was generated from the following file: