ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilIndividualAssessmentMembersStorageDB Class Reference

Store member infos to DB. More...

+ Inheritance diagram for ilIndividualAssessmentMembersStorageDB:
+ Collaboration diagram for ilIndividualAssessmentMembersStorageDB:

Public Member Functions

 __construct ($ilDB)
 
 loadMembers (ilObjIndividualAssessment $obj)
 Get ilIndividualAssessmentMembers-object containing meberinfo associated with $obj.
Parameters
ilObjIndividualAssessment$obj
Returns
ilIndividualAssessmentMembers
More...
 
 loadMember (ilObjIndividualAssessment $obj, ilObjUser $usr)
 Get ilIndividualAssessmentMember-object containing meberinfo associated with $obj and $usr.
Parameters
ilObjIndividualAssessment$obj
ilObjUser$usr
Returns
ilIndividualAssessmentMember
More...
 
 updateMember (ilIndividualAssessmentMember $member)
 Create a new storage entry for member-object.
Parameters
ilIndividualAssessmentMember$member
More...
 
 deleteMembers (ilObjIndividualAssessment $obj)
 Delete entries associated with members-object.
Parameters
ilObjIndividualAssessment$obj
More...
 
 insertMembersRecord (ilObjIndividualAssessment $iass, array $record)
 Create a membership inside storage.
Parameters
ilObjIndividualAssessment$iass
string|int[]$record
More...
 
 removeMembersRecord (ilObjIndividualAssessment $iass, array $record)
 Remove a membership associated with a IndividualAssessment object inside storage.
Parameters
ilObjIndividualAssessment$iass
string|int[]$record
More...
 

Data Fields

const MEMBERS_TABLE = "iass_members"
 

Protected Member Functions

 loadMembersQuery ($obj_id)
 

Protected Attributes

 $db
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilIndividualAssessmentMembersStorageDB::__construct (   $ilDB)

Definition at line 20 of file class.ilIndividualAssessmentMembersStorageDB.php.

References $ilDB.

21  {
22  $this->db = $ilDB;
23  }
global $ilDB

Member Function Documentation

◆ deleteMembers()

ilIndividualAssessmentMembersStorageDB::deleteMembers ( ilObjIndividualAssessment  $obj)

Delete entries associated with members-object.

Parameters
ilObjIndividualAssessment$obj

Implements ilIndividualAssessmentMembersStorage.

Definition at line 108 of file class.ilIndividualAssessmentMembersStorageDB.php.

References ilObject\getId().

109  {
110  $sql = "DELETE FROM " . self::MEMBERS_TABLE . " WHERE obj_id = " . $this->db->quote($obj->getId(), 'integer');
111  $this->db->manipulate($sql);
112  }
getId()
get object id public
+ Here is the call graph for this function:

◆ insertMembersRecord()

ilIndividualAssessmentMembersStorageDB::insertMembersRecord ( ilObjIndividualAssessment  $iass,
array  $record 
)

Create a membership inside storage.

Parameters
ilObjIndividualAssessment$iass
string|int[]$record

Implements ilIndividualAssessmentMembersStorage.

Definition at line 140 of file class.ilIndividualAssessmentMembersStorageDB.php.

References array, ilIndividualAssessmentMembers\FIELD_CHANGE_TIME, ilIndividualAssessmentMembers\FIELD_CHANGER_ID, ilIndividualAssessmentMembers\FIELD_EVENTTIME, ilIndividualAssessmentMembers\FIELD_EXAMINER_ID, ilIndividualAssessmentMembers\FIELD_FILE_NAME, ilIndividualAssessmentMembers\FIELD_FINALIZED, ilIndividualAssessmentMembers\FIELD_INTERNAL_NOTE, ilIndividualAssessmentMembers\FIELD_LEARNING_PROGRESS, ilIndividualAssessmentMembers\FIELD_NOTIFICATION_TS, ilIndividualAssessmentMembers\FIELD_NOTIFY, ilIndividualAssessmentMembers\FIELD_PLACE, ilIndividualAssessmentMembers\FIELD_RECORD, ilIndividualAssessmentMembers\FIELD_USER_VIEW_FILE, ilIndividualAssessmentMembers\FIELD_USR_ID, and ilObject\getId().

141  {
142  $values = array("obj_id" => array("integer", $iass->getId())
143  , "usr_id" => array("integer", $record[ilIndividualAssessmentMembers::FIELD_USR_ID])
157  );
158 
159  $this->db->insert(self::MEMBERS_TABLE, $values);
160  }
getId()
get object id public
Create styles array
The data for the language used.
+ Here is the call graph for this function:

◆ loadMember()

ilIndividualAssessmentMembersStorageDB::loadMember ( ilObjIndividualAssessment  $obj,
ilObjUser  $usr 
)

Get ilIndividualAssessmentMember-object containing meberinfo associated with $obj and $usr.

Parameters
ilObjIndividualAssessment$obj
ilObjUser$usr
Returns
ilIndividualAssessmentMember

Implements ilIndividualAssessmentMembersStorage.

Definition at line 43 of file class.ilIndividualAssessmentMembersStorageDB.php.

References ilObject\getId().

44  {
45  $obj_id = $obj->getId();
46  $usr_id = $usr->getId();
47  $sql = "SELECT "
48  . "iassme.obj_id,"
49  . "iassme.usr_id,"
50  . "iassme.examiner_id,"
51  . "iassme.record,"
52  . "iassme.internal_note,"
53  . "iassme.notify,"
54  . "iassme.notification_ts,"
55  . "iassme.learning_progress,"
56  . "iassme.finalized,"
57  . "iassme.place,"
58  . "iassme.event_time,"
59  . "iassme.user_view_file,"
60  . "iassme.file_name,"
61  . "iassme.changer_id,"
62  . "iassme.change_time"
63  . " FROM " . self::MEMBERS_TABLE . " iassme\n"
64  . " JOIN usr_data usr ON iassme.usr_id = usr.usr_id\n"
65  . " LEFT JOIN usr_data ex ON iassme.examiner_id = ex.usr_id\n"
66  . " WHERE obj_id = " . $this->db->quote($obj_id, 'integer') . "\n"
67  . " AND iassme.usr_id = " . $this->db->quote($usr_id, 'integer');
68 
69  $rec = $this->db->fetchAssoc($this->db->query($sql));
70  if ($rec) {
71  $member = new ilIndividualAssessmentMember($obj, $usr, $rec);
72  return $member;
73  } else {
74  throw new ilIndividualAssessmentException("invalid usr-obj combination");
75  }
76  }
getId()
get object id public
Edit the record of a user, set LP.
+ Here is the call graph for this function:

◆ loadMembers()

ilIndividualAssessmentMembersStorageDB::loadMembers ( ilObjIndividualAssessment  $obj)

Get ilIndividualAssessmentMembers-object containing meberinfo associated with $obj.

Parameters
ilObjIndividualAssessment$obj
Returns
ilIndividualAssessmentMembers

Implements ilIndividualAssessmentMembersStorage.

Definition at line 28 of file class.ilIndividualAssessmentMembersStorageDB.php.

References $res, ilObject\getId(), and loadMembersQuery().

29  {
30  $members = new ilIndividualAssessmentMembers($obj);
31  $obj_id = $obj->getId();
32  $sql = $this->loadMembersQuery($obj_id);
33  $res = $this->db->query($sql);
34  while ($rec = $this->db->fetchAssoc($res)) {
35  $members = $members->withAdditionalRecord($rec);
36  }
37  return $members;
38  }
foreach($_POST as $key=> $value) $res
getId()
get object id public
Member administration related logic, add and remove members, get the list of all members, etc.
+ Here is the call graph for this function:

◆ loadMembersQuery()

ilIndividualAssessmentMembersStorageDB::loadMembersQuery (   $obj_id)
protected

Definition at line 117 of file class.ilIndividualAssessmentMembersStorageDB.php.

References ilIndividualAssessmentMembers\FIELD_CHANGER_FIRSTNAME, ilIndividualAssessmentMembers\FIELD_CHANGER_LASTNAME, ilIndividualAssessmentMembers\FIELD_EXAMINER_FIRSTNAME, ilIndividualAssessmentMembers\FIELD_EXAMINER_LASTNAME, ilIndividualAssessmentMembers\FIELD_FILE_NAME, ilIndividualAssessmentMembers\FIELD_FIRSTNAME, ilIndividualAssessmentMembers\FIELD_LASTNAME, and ilIndividualAssessmentMembers\FIELD_LOGIN.

Referenced by loadMembers().

118  {
119  return "SELECT ex.firstname as " . ilIndividualAssessmentMembers::FIELD_EXAMINER_FIRSTNAME
123  . " ,usr.firstname as " . ilIndividualAssessmentMembers::FIELD_FIRSTNAME
124  . " ,usr.lastname as " . ilIndividualAssessmentMembers::FIELD_LASTNAME
125  . " ,usr.login as " . ilIndividualAssessmentMembers::FIELD_LOGIN
127  . " ,iassme.obj_id, iassme.usr_id, iassme.examiner_id, iassme.record, iassme.internal_note, iassme.notify"
128  . " ,iassme.notification_ts, iassme.learning_progress, iassme.finalized,iassme.place"
129  . " ,iassme.event_time, iassme.changer_id, iassme.change_time\n"
130  . " FROM iass_members iassme"
131  . " JOIN usr_data usr ON iassme.usr_id = usr.usr_id"
132  . " LEFT JOIN usr_data ex ON iassme.examiner_id = ex.usr_id"
133  . " LEFT JOIN usr_data ud ON iassme.changer_id = ud.usr_id"
134  . " WHERE obj_id = " . $this->db->quote($obj_id, 'integer');
135  }
+ Here is the caller graph for this function:

◆ removeMembersRecord()

ilIndividualAssessmentMembersStorageDB::removeMembersRecord ( ilObjIndividualAssessment  $iass,
array  $record 
)

Remove a membership associated with a IndividualAssessment object inside storage.

Parameters
ilObjIndividualAssessment$iass
string|int[]$record

Implements ilIndividualAssessmentMembersStorage.

Definition at line 165 of file class.ilIndividualAssessmentMembersStorageDB.php.

References ilIndividualAssessmentMembers\FIELD_USR_ID, and ilObject\getId().

166  {
167  $sql = "DELETE FROM " . self::MEMBERS_TABLE . "\n"
168  . " WHERE obj_id = " . $this->db->quote($iass->getId(), 'integer') . "\n"
169  . " AND usr_id = " . $this->db->quote($record[ilIndividualAssessmentMembers::FIELD_USR_ID], 'integer');
170 
171  $this->db->manipulate($sql);
172  }
getId()
get object id public
+ Here is the call graph for this function:

◆ updateMember()

ilIndividualAssessmentMembersStorageDB::updateMember ( ilIndividualAssessmentMember  $member)

Create a new storage entry for member-object.

Parameters
ilIndividualAssessmentMember$member

Implements ilIndividualAssessmentMembersStorage.

Definition at line 81 of file class.ilIndividualAssessmentMembersStorageDB.php.

References array, ilIndividualAssessmentMember\assessmentId(), ilIndividualAssessmentMember\changerId(), ilIndividualAssessmentMember\eventTime(), ilIndividualAssessmentMember\examinerId(), ilIndividualAssessmentMembers\FIELD_CHANGE_TIME, ilIndividualAssessmentMembers\FIELD_CHANGER_ID, ilIndividualAssessmentMembers\FIELD_EVENTTIME, ilIndividualAssessmentMembers\FIELD_EXAMINER_ID, ilIndividualAssessmentMembers\FIELD_FILE_NAME, ilIndividualAssessmentMembers\FIELD_FINALIZED, ilIndividualAssessmentMembers\FIELD_INTERNAL_NOTE, ilIndividualAssessmentMembers\FIELD_LEARNING_PROGRESS, ilIndividualAssessmentMembers\FIELD_NOTIFICATION_TS, ilIndividualAssessmentMembers\FIELD_NOTIFY, ilIndividualAssessmentMembers\FIELD_PLACE, ilIndividualAssessmentMembers\FIELD_RECORD, ilIndividualAssessmentMembers\FIELD_USER_VIEW_FILE, ilIndividualAssessmentMember\fileName(), ilIndividualAssessmentMember\finalized(), ilIndividualAssessmentMember\id(), IL_CAL_DATETIME, IL_CAL_UNIX, ilIndividualAssessmentMember\internalNote(), ilIndividualAssessmentMember\LPStatus(), ilIndividualAssessmentMember\notificationTS(), ilIndividualAssessmentMember\notify(), ilIndividualAssessmentMember\place(), ilIndividualAssessmentMember\record(), time, and ilIndividualAssessmentMember\viewFile().

82  {
83  $where = array("obj_id" => array("integer", $member->assessmentId())
84  , "usr_id" => array("integer", $member->id())
85  );
86 
93  , ilIndividualAssessmentMembers::FIELD_NOTIFY => array("integer", $member->notify() ? 1 : 0)
94  , ilIndividualAssessmentMembers::FIELD_FINALIZED => array("integer", $member->finalized() ? 1 : 0)
97  , ilIndividualAssessmentMembers::FIELD_USER_VIEW_FILE => array("integer", $member->viewFile() ? 1 : 0)
100  );
101 
102  $this->db->update(self::MEMBERS_TABLE, $values, $where);
103  }
const IL_CAL_DATETIME
examinerId()
Get the user id of the examiner.
const IL_CAL_UNIX
notificationTS()
Get the timestamp, at which the notification was sent.
finalized()
Is this membership allready finalized?
changerId()
Get the user id of the changer.
Date and time handling
Create styles array
The data for the language used.
viewFile()
Can user see the uploaded file.
notify()
Will the user be notified after finalization?
fileName()
Get the name of the uploaded file.
assessmentId()
Get the ilObjIndividualAssessment id corresponding to this membership.
Add data(end) time
Method that wraps PHPs time in order to allow simulations with the workflow.
id()
Get the user id corresponding to this membership.
LPStatus()
Get the LP-status corresponding to this membership.
+ Here is the call graph for this function:

Field Documentation

◆ $db

ilIndividualAssessmentMembersStorageDB::$db
protected

◆ MEMBERS_TABLE

const ilIndividualAssessmentMembersStorageDB::MEMBERS_TABLE = "iass_members"

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