ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilIndividualAssessmentSettingsStorageDB Class Reference

A settings storage handler to write iass settings to db. More...

+ Inheritance diagram for ilIndividualAssessmentSettingsStorageDB:
+ Collaboration diagram for ilIndividualAssessmentSettingsStorageDB:

Public Member Functions

 __construct ($db)
 
 createSettings (ilIndividualAssessmentSettings $settings)
 Create a entry corresponding to $settings.
Parameters
ilIndividualAssessmentSettings$settings
More...
 
 loadSettings (ilObjIndividualAssessment $obj)
 Load settings corresponding to obj.
Parameters
ilObjIndividualAssessment$obj
Returns
ilIndividualAssessmentSettings $settings
More...
 
 updateSettings (ilIndividualAssessmentSettings $settings)
 Update settings entry.
Parameters
ilIndividualAssessmentSettings$settings
More...
 
 loadInfoSettings (ilObjIndividualAssessment $obj)
 Load info-screen settings corresponding to obj. More...
 
 updateInfoSettings (ilIndividualAssessmentInfoSettings $settings)
 Update info-screen settings entry. More...
 
 deleteSettings (ilObjIndividualAssessment $obj)
 Delete settings entry corresponding to obj.
Parameters
ilObjIndividualAssessment$obj
Returns
ilIndividualAssessmentSettings $settings
More...
 

Protected Attributes

 $db
 

Detailed Description

A settings storage handler to write iass settings to db.

Author
Denis Klöpfer denis.nosp@m..klo.nosp@m.epfer.nosp@m.@con.nosp@m.cepts.nosp@m.-and.nosp@m.-trai.nosp@m.ning.nosp@m..de

Definition at line 10 of file class.ilIndividualAssessmentSettingsStorageDB.php.

Constructor & Destructor Documentation

◆ __construct()

ilIndividualAssessmentSettingsStorageDB::__construct (   $db)

Member Function Documentation

◆ createSettings()

ilIndividualAssessmentSettingsStorageDB::createSettings ( ilIndividualAssessmentSettings  $settings)

Create a entry corresponding to $settings.

Parameters
ilIndividualAssessmentSettings$settings

Implements ilIndividualAssessmentSettingsStorage.

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

References array, ilIndividualAssessmentSettings\content(), ilIndividualAssessmentSettings\getId(), and ilIndividualAssessmentSettings\recordTemplate().

20  {
21  $sql = "INSERT INTO iass_settings (content,record_template,obj_id) VALUES (%s,%s,%s)";
22  $this->db->manipulateF($sql,array("text","text","integer"),array($settings->content(),$settings->recordTemplate(),$settings->getId()));
23  $sql = "INSERT INTO iass_info_settings (obj_id) VALUES (%s)";
24  $this->db->manipulateF($sql,array("integer"),array($settings->getId()));
25  }
recordTemplate()
Get the record template to be used as default record with corresponding object.
content()
Get the content of this assessment, e.g.
getId()
Get the id of corrwsponding iass-object.
Create styles array
The data for the language used.
+ Here is the call graph for this function:

◆ deleteSettings()

ilIndividualAssessmentSettingsStorageDB::deleteSettings ( ilObjIndividualAssessment  $obj)

Delete settings entry corresponding to obj.

Parameters
ilObjIndividualAssessment$obj
Returns
ilIndividualAssessmentSettings $settings

Implements ilIndividualAssessmentSettingsStorage.

Definition at line 104 of file class.ilIndividualAssessmentSettingsStorageDB.php.

References array, and ilObject\getId().

104  {
105  $sql = 'DELETE FROM iass_settings WHERE obj_id = %s';
106  $this->db->manipulateF($sql,array("integer"),array($obj->getId()));
107  $sql = 'DELETE FROM iass_info_settings WHERE obj_id = %s';
108  $this->db->manipulateF($sql,array("integer"),array($obj->getId()));
109  }
getId()
get object id public
Create styles array
The data for the language used.
+ Here is the call graph for this function:

◆ loadInfoSettings()

ilIndividualAssessmentSettingsStorageDB::loadInfoSettings ( ilObjIndividualAssessment  $obj)

Load info-screen settings corresponding to obj.

Parameters
ilObjIndividualAssessment$obj
Returns
ilIndividualAssessmentSettings $settings

Implements ilIndividualAssessmentSettingsStorage.

Definition at line 59 of file class.ilIndividualAssessmentSettingsStorageDB.php.

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

59  {
60  if(ilObjIndividualAssessment::_exists($obj->getId(), false, 'iass')) {
61  $obj_id = $obj->getId();
62  assert('is_numeric($obj_id)');
63  $sql = 'SELECT contact, responsibility, phone, mails, consultation_hours'
64  .' FROM iass_info_settings WHERE obj_id = '.$this->db->quote($obj_id,'integer');
65  if($res = $this->db->fetchAssoc($this->db->query($sql))) {
66  return new ilIndividualAssessmentInfoSettings($obj,
67  $res["contact"]
68  ,$res["responsibility"]
69  ,$res['phone']
70  ,$res['mails']
71  ,$res['consultation_hours']);
72  }
73  throw new ilIndividualAssessmentException("$obj_id not in database");
74  } else {
75  return new ilIndividualAssessmentInfoSettings($obj);
76  }
77  }
static _exists($a_id, $a_reference=false, $a_type=null)
checks if an object exists in object_data
getId()
get object id public
+ Here is the call graph for this function:

◆ loadSettings()

ilIndividualAssessmentSettingsStorageDB::loadSettings ( ilObjIndividualAssessment  $obj)

Load settings corresponding to obj.

Parameters
ilObjIndividualAssessment$obj
Returns
ilIndividualAssessmentSettings $settings

Implements ilIndividualAssessmentSettingsStorage.

Definition at line 30 of file class.ilIndividualAssessmentSettingsStorageDB.php.

References $res, ilObject\_exists(), ilIndividualAssessmentSettings\DEF_CONTENT, ilIndividualAssessmentSettings\DEF_RECORD_TEMPLATE, and ilObject\getId().

30  {
31  if(ilObjIndividualAssessment::_exists($obj->getId(), false, 'iass')) {
32  $obj_id = $obj->getId();
33  assert('is_numeric($obj_id)');
34  $sql = 'SELECT content, record_template FROM iass_settings WHERE obj_id = '.$this->db->quote($obj_id,'integer');
35  if($res = $this->db->fetchAssoc($this->db->query($sql))) {
36  return new ilIndividualAssessmentSettings($obj, $res["content"],$res["record_template"]);
37  }
38  throw new ilIndividualAssessmentException("$obj_id not in database");
39  } else {
41  }
42  }
static _exists($a_id, $a_reference=false, $a_type=null)
checks if an object exists in object_data
An object carrying settings of an Individual Assessment obj beyond the standart information.
getId()
get object id public
+ Here is the call graph for this function:

◆ updateInfoSettings()

ilIndividualAssessmentSettingsStorageDB::updateInfoSettings ( ilIndividualAssessmentInfoSettings  $settings)

Update info-screen settings entry.

Parameters
ilIndividualAssessmentSettings$settings

Implements ilIndividualAssessmentSettingsStorage.

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

References array, ilIndividualAssessmentInfoSettings\consultationHours(), ilIndividualAssessmentInfoSettings\contact(), ilIndividualAssessmentInfoSettings\id(), ilIndividualAssessmentInfoSettings\mails(), ilIndividualAssessmentInfoSettings\phone(), and ilIndividualAssessmentInfoSettings\responsibility().

84  {
85  $sql = 'UPDATE iass_info_settings SET '
86  .' contact = %s'
87  .' ,responsibility = %s'
88  .' ,phone = %s'
89  .' ,mails = %s'
90  .' ,consultation_hours = %s'
91  .' WHERE obj_id = %s';
92  $this->db->manipulateF($sql,array('text','text','text','text','text','integer'),
93  array( $settings->contact()
94  ,$settings->responsibility()
95  ,$settings->phone()
96  ,$settings->mails()
97  ,$settings->consultationHours()
98  ,$settings->id()));
99  }
Create styles array
The data for the language used.
+ Here is the call graph for this function:

◆ updateSettings()

ilIndividualAssessmentSettingsStorageDB::updateSettings ( ilIndividualAssessmentSettings  $settings)

Update settings entry.

Parameters
ilIndividualAssessmentSettings$settings

Implements ilIndividualAssessmentSettingsStorage.

Definition at line 47 of file class.ilIndividualAssessmentSettingsStorageDB.php.

References array, ilIndividualAssessmentSettings\content(), ilIndividualAssessmentSettings\getId(), and ilIndividualAssessmentSettings\recordTemplate().

47  {
48  $sql = 'UPDATE iass_settings SET content = %s,record_template = %s WHERE obj_id = %s';
49  $this->db->manipulateF($sql,array("text","text","integer"),array($settings->content(),$settings->recordTemplate(),$settings->getId()));
50  }
recordTemplate()
Get the record template to be used as default record with corresponding object.
content()
Get the content of this assessment, e.g.
getId()
Get the id of corrwsponding iass-object.
Create styles array
The data for the language used.
+ Here is the call graph for this function:

Field Documentation

◆ $db

ilIndividualAssessmentSettingsStorageDB::$db
protected

Definition at line 12 of file class.ilIndividualAssessmentSettingsStorageDB.php.

Referenced by __construct().


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