ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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 110 of file class.ilObjectCustomUserFieldHistory.php.

References $ilDB, and $query.

111  {
112  global $ilDB;
113 
114  $query = 'DELETE FROM obj_user_data_hist ' .
115  'WHERE obj_id = ' . $ilDB->quote($this->obj_id, 'integer') . ' ' .
116  'AND usr_id = ' . $ilDB->quote($this->user_id, 'integer');
117  $ilDB->manipulate($query);
118  }
$query
global $ilDB

◆ getEditingTime()

ilObjectCustomUserFieldHistory::getEditingTime ( )

Get editing time.

Returns
ilDateTime

Definition at line 83 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 65 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 $ilDB, $query, $res, $row, $users, array, ilDBConstants\FETCHMODE_OBJECT, IL_CAL_DATETIME, and ilTimeZone\UTC.

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

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  $users[$row->usr_id]['update_user'] = $row->update_user;
47  $users[$row->usr_id]['editing_time'] = new ilDateTime($row->editing_time, IL_CAL_DATETIME, ilTimeZone::UTC);
48  }
49  return $users;
50  }
const IL_CAL_DATETIME
foreach($_POST as $key=> $value) $res
Date and time handling
$query
Create styles array
The data for the language used.
$users
Definition: authpage.php:44
global $ilDB
+ Here is the caller graph for this function:

◆ read()

ilObjectCustomUserFieldHistory::read ( )
protected

read entry type $ilDB

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

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

Referenced by __construct().

125  {
126  global $ilDB;
127 
128  $query = 'SELECT * FROM obj_user_data_hist ' .
129  'WHERE obj_id = ' . $ilDB->quote($this->obj_id, 'integer') . ' ' .
130  'AND usr_id = ' . $ilDB->quote($this->user_id, 'integer');
131  $res = $ilDB->query($query);
132  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
133  $this->setEditingTime(new ilDateTime($row->editing_time, IL_CAL_DATETIME, ilTimeZone::UTC));
134  $this->setUpdateUser($row->update_user);
135  }
136  }
const IL_CAL_DATETIME
setEditingTime(ilDateTime $dt)
Set editing time.
foreach($_POST as $key=> $value) $res
Date and time handling
$query
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 91 of file class.ilObjectCustomUserFieldHistory.php.

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

92  {
93  global $ilDB;
94 
95  $this->delete();
96 
97  $query = 'INSERT INTO obj_user_data_hist (obj_id, usr_id, update_user, editing_time) ' .
98  'VALUES( ' .
99  $ilDB->quote($this->obj_id, 'integer') . ', ' .
100  $ilDB->quote($this->user_id, 'integer') . ', ' .
101  $ilDB->quote($this->getUpdateUser(), 'integer') . ', ' .
102  $ilDB->quote($this->getEditingTime()->get(IL_CAL_DATETIME, '', ilTimeZone::UTC)) . ' ' .
103  ')';
104  $ilDB->manipulate($query);
105  }
const IL_CAL_DATETIME
$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 74 of file class.ilObjectCustomUserFieldHistory.php.

Referenced by read().

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

◆ setUpdateUser()

ilObjectCustomUserFieldHistory::setUpdateUser (   $a_id)

Set update user.

Parameters
int$a_id

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

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

57  {
58  $this->update_user = $a_id;
59  }
+ 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: