ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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 111 of file class.ilObjectCustomUserFieldHistory.php.

References $ilDB, and $query.

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  }
global $ilDB

◆ getEditingTime()

ilObjectCustomUserFieldHistory::getEditingTime ( )

Get editing time.

Returns
ilDateTime

Definition at line 84 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 66 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, 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  {
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  }
const IL_CAL_DATETIME
Date and time handling
Create styles array
The data for the language used.
global $ilDB
+ Here is the caller graph for this function:

◆ read()

ilObjectCustomUserFieldHistory::read ( )
protected

read entry type $ilDB

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

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

Referenced by __construct().

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  }
const IL_CAL_DATETIME
setEditingTime(ilDateTime $dt)
Set editing time.
Date and time handling
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 92 of file class.ilObjectCustomUserFieldHistory.php.

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

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  }
const IL_CAL_DATETIME
global $ilDB
+ Here is the call graph for this function:

◆ setEditingTime()

ilObjectCustomUserFieldHistory::setEditingTime ( ilDateTime  $dt)

Set editing time.

Parameters
ilDateTime$dt

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

Referenced by read().

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

◆ setUpdateUser()

ilObjectCustomUserFieldHistory::setUpdateUser (   $a_id)

Set update user.

Parameters
int$a_id

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

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

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