ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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 @global type $ilDB. More...
 

Protected Member Functions

 read ()
 read entry @global 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.

24 {
25 $this->obj_id = $a_obj_id;
26 $this->user_id = $a_user_id;
27 $this->read();
28 }

References read().

+ 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.

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

References $ilDB, and $query.

◆ getEditingTime()

ilObjectCustomUserFieldHistory::getEditingTime ( )

Get editing time.

Returns
ilDateTime

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

References $editing_time.

◆ 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 @global type $ilDB.

Parameters
type$a_obj_id
Returns
\ilDateTime

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

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(DB_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 DB_FETCHMODE_OBJECT
Definition: class.ilDB.php:11
const IL_CAL_DATETIME
@classDescription Date and time handling

References $ilDB, $query, $res, $row, DB_FETCHMODE_OBJECT, IL_CAL_DATETIME, and ilTimeZone\UTC.

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

+ Here is the caller graph for this function:

◆ read()

ilObjectCustomUserFieldHistory::read ( )
protected

read entry @global type $ilDB

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

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(DB_FETCHMODE_OBJECT))
134 {
136 $this->setUpdateUser($row->update_user);
137 }
138 }
setEditingTime(ilDateTime $dt)
Set editing time.

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

Referenced by __construct().

+ 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.

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 }

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

+ 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.

76 {
77 $this->editing_time = $dt;
78 }

Referenced by read().

+ 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.

58 {
59 $this->update_user = $a_id;
60 }

Referenced by read().

+ 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: