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

Individual Assessment dataset class. More...

+ Inheritance diagram for ilIndividualAssessmentDataSet:
+ Collaboration diagram for ilIndividualAssessmentDataSet:

Public Member Functions

 getSupportedVersions ()
 
 getXmlNamespace ($entity, $schema_version)
 
 readData ($entity, $version, $ids)
 Read data from Cache for a given entity and ID(s) More...
 
 importRecord ($entity, $types, array $rec, ilImportMapping $mapping, $schema_version)
 Import record. More...
 
- Public Member Functions inherited from ilDataSet
 __construct ()
 Constructor. More...
 
 init ($a_entity, $a_schema_version)
 Init. More...
 
 getSupportedVersions ()
 Get supported version. More...
 
 readData ($a_entity, $a_version, $a_ids)
 Read data from DB. More...
 
 setExportDirectories ($a_relative, $a_absolute)
 Set export directories. More...
 
 setImportDirectory ($a_val)
 Set import directory. More...
 
 getImportDirectory ()
 Get import directory. More...
 
 setDSPrefix ($a_val)
 Set XML dataset namespace prefix. More...
 
 getDSPrefix ()
 Get XML dataset namespace prefix. More...
 
 getDSPrefixString ()
 
 getDirectDataFromQuery ($a_query, $a_convert_to_leading_upper=true, $a_set=true)
 Get data from query.This is a standard procedure, all db field names are directly mapped to abstract fields. More...
 
 convertToLeadingUpper ($a_str)
 Make xyz_abc a XyzAbc string. More...
 
 getJsonRepresentation ()
 Get json representation. More...
 
 getXmlRepresentation ( $a_entity, $a_schema_version, $a_ids, $a_field="", $a_omit_header=false, $a_omit_types=false)
 Get xml representation <dataset install_id="123" install_url="..."> <types entity="table_name" version="4.0.1"> <ftype name="field_1" type="text"> <ftype name="field_2" type="date"> <ftype name="field_3" type="integer"> </types> <types ...> ... More...
 
 addRecordsXml ($a_writer, $a_prefixes, $a_entity, $a_schema_version, $a_ids, $a_field="")
 Add records xml. More...
 
 afterXmlRecordWriting ($a_entity, $a_version, $a_set)
 After xml record writing hook record. More...
 
 getNamespaces (&$namespaces, $a_entity, $a_schema_version)
 Get xml namespaces. More...
 
 getXmlRecord ($a_entity, $a_version, $a_set)
 Get xml record for version. More...
 
 getJsonRecord ($a_set)
 Get json record for version. More...
 
 getXmlTypes ($a_entity, $a_version)
 Get xml types. More...
 
 getJsonTypes ($a_entity, $a_version)
 Get json types. More...
 
 getXMLEntityName ($a_entity, $a_version)
 Get entity name for xml (may be overwritten) More...
 
 getXMLEntityTag ($a_entity, $a_schema_version)
 Get entity tag. More...
 
 getJsonEntityName ($a_entity, $a_version)
 Get entity name for json (may be overwritten) More...
 
 setImport ($a_val)
 Set import object. More...
 
 getImport ()
 Get import object. More...
 
 setCurrentInstallationId ($a_val)
 Set current installation id. More...
 
 getCurrentInstallationId ()
 Get current installation id. More...
 

Protected Member Functions

 getTypes ($entity, $version)
 Map XML attributes of entities to datatypes (text, integer...) More...
 
 getDependencies ($entity, $version, $rec, $ids)
 Return dependencies form entities to other entities (in our case these are all the DB relations) More...
 
 _readData ($entity, $ids)
 Build data array, data is read from cache except iass object itself. More...
 
- Protected Member Functions inherited from ilDataSet
 getTypes ($a_entity, $a_version)
 Get (abstract) types for (abstract) field names. More...
 
 getXmlNamespace ($a_entity, $a_schema_version)
 Get xml namespace. More...
 
 createObjectExportId ($a_type, $a_id)
 Build ilias export id. More...
 
 parseObjectExportId ($a_id, $a_fallback_id=null)
 Parse export id. More...
 

Additional Inherited Members

- Data Fields inherited from ilDataSet
 $dircnt
 
const EXPORT_NO_INST_ID = 1
 
const EXPORT_ID_ILIAS_LOCAL = 2
 
const EXPORT_ID_ILIAS_LOCAL_INVALID = 3
 
const EXPORT_ID_ILIAS_REMOTE = 4
 
const EXPORT_ID_ILIAS_REMOTE_INVALID = 5
 
const EXPORT_ID = 6
 
const EXPORT_ID_INVALID = 7
 
- Protected Attributes inherited from ilDataSet
 $current_installation_id = ""
 
 $db
 
 $ds_log
 

Detailed Description

Member Function Documentation

◆ _readData()

ilIndividualAssessmentDataSet::_readData (   $entity,
  $ids 
)
protected

Build data array, data is read from cache except iass object itself.

Parameters
string$entity
array$ids

Definition at line 101 of file class.ilIndividualAssessmentDataSet.php.

References $data, $info, ilObject\_lookupType(), array, and data.

Referenced by readData().

102  {
103  switch ($entity) {
104  case 'iass':
105  foreach ($ids as $iass_id) {
106  if (ilObject::_lookupType($iass_id) == 'iass') {
107  $obj = new ilObjIndividualAssessment($iass_id, false);
108  $settings = $obj->getSettings();
109  $info = $obj->getInfoSettings();
110  $data = array(
111  'id' => $iass_id,
112  'title' => $obj->getTitle(),
113  'description' => $obj->getDescription(),
114  'content' => $settings->content(),
115  'recordTemplate' => $settings->recordTemplate(),
116  'eventTimePlaceRequired' => (int) $settings->eventTimePlaceRequired(),
117  'file_required' => (int) $settings->fileRequired(),
118  "contact" => $info->contact(),
119  "responsibility" => $info->responsibility(),
120  "phone" => $info->phone(),
121  "mails" => $info->mails(),
122  "consultation_hours" => $info->consultationHours()
123  );
124  $this->data[] = $data;
125  }
126  }
127  break;
128  default:
129  }
130  }
Add some data
For the purpose of streamlining the grading and learning-process status definition outside of tests...
Create styles array
The data for the language used.
static _lookupType($a_id, $a_reference=false)
lookup object type
$info
Definition: index.php:5
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getDependencies()

ilIndividualAssessmentDataSet::getDependencies (   $entity,
  $version,
  $rec,
  $ids 
)
protected

Return dependencies form entities to other entities (in our case these are all the DB relations)

Parameters
string$entity
string$version
array$rec
array$ids
Returns
array

Definition at line 74 of file class.ilIndividualAssessmentDataSet.php.

75  {
76  return false;
77  }

◆ getSupportedVersions()

ilIndividualAssessmentDataSet::getSupportedVersions ( )
Returns
array

Definition at line 16 of file class.ilIndividualAssessmentDataSet.php.

References array.

17  {
18  return array('5.2.0', '5.3.0');
19  }
Create styles array
The data for the language used.

◆ getTypes()

ilIndividualAssessmentDataSet::getTypes (   $entity,
  $version 
)
protected

Map XML attributes of entities to datatypes (text, integer...)

Parameters
string$entity
string$version
Returns
array

Definition at line 41 of file class.ilIndividualAssessmentDataSet.php.

References array.

42  {
43  switch ($entity) {
44  case 'iass':
45  return array(
46  "id" => "integer",
47  "title" => "text",
48  "description" => "text",
49  "content" => "text",
50  "recordTemplate" => "text",
51  "eventTimePlaceRequired" => "integer",
52  "file_required" => "integer",
53  "contact" => "text",
54  "responsibility" => "text",
55  "phone" => "text",
56  "mails" => "text",
57  "consultation_hours" => "text"
58  );
59  default:
60  return array();
61  }
62  }
Create styles array
The data for the language used.

◆ getXmlNamespace()

ilIndividualAssessmentDataSet::getXmlNamespace (   $entity,
  $schema_version 
)
Parameters
string$entity
string$schema_version
Returns
string

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

29  {
30  return 'http://www.ilias.de/xml/Modules/IndividualAssessment/' . $entity;
31  }

◆ importRecord()

ilIndividualAssessmentDataSet::importRecord (   $entity,
  $types,
array  $rec,
ilImportMapping  $mapping,
  $schema_version 
)

Import record.

Parameters
string$entity
ilIndividualAssessmentDataSet  |  null$types
array$rec
ilImportMapping$mapping
string$schema_version
Returns
void

Definition at line 142 of file class.ilIndividualAssessmentDataSet.php.

References $info, ilImportMapping\addMapping(), ilObjectFactory\getInstanceByObjId(), and ilImportMapping\getMapping().

143  {
144  assert('is_string($entity)');
145  assert('is_object($types) || is_null($types)');
146  assert('is_string($schema_version)');
147 
148  switch ($entity) {
149  case "iass":
150  if ($new_id = $mapping->getMapping('Services/Container', 'objs', $rec['Id'])) {
151  $newObj = ilObjectFactory::getInstanceByObjId($new_id, false);
152  } else {
153  $newObj = new ilObjIndividualAssessment();
154  $newObj->create();
155  }
156  $settings = new ilIndividualAssessmentSettings(
157  $newObj,
158  $rec["content"],
159  $rec["recordTemplate"],
160  $rec['file_required'],
161  $rec['eventTimePlaceRequired']
162  );
163 
165  $newObj,
166  $rec['contact'],
167  $rec['responsibility'],
168  $rec['phone'],
169  $rec['mails'],
170  $rec['consultation_hours']
171  );
172 
173  $newObj->setTitle($rec["title"]);
174  $newObj->setDescription($rec["description"]);
175  $newObj->setSettings($settings);
176  $newObj->setInfoSettings($info);
177  $newObj->update();
178  $newObj->updateInfo();
179 
180  $mapping->addMapping("Modules/IndividualAssessment", "iass", $rec["Id"], $newObj->getId());
181  break;
182  }
183  }
getMapping($a_comp, $a_entity, $a_old_id)
Get a mapping.
For the purpose of streamlining the grading and learning-process status definition outside of tests...
An object carrying settings of an Individual Assessment obj beyond the standart information.
addMapping($a_comp, $a_entity, $a_old_id, $a_new_id)
Add mapping.
static getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
$info
Definition: index.php:5
+ Here is the call graph for this function:

◆ readData()

ilIndividualAssessmentDataSet::readData (   $entity,
  $version,
  $ids 
)

Read data from Cache for a given entity and ID(s)

Parameters
string$entity
string$version
array$idsone or multiple ids

Definition at line 86 of file class.ilIndividualAssessmentDataSet.php.

References _readData(), array, and data.

87  {
88  $this->data = array();
89  if (!is_array($ids)) {
90  $ids = array($ids);
91  }
92  $this->_readData($entity, $ids);
93  }
Add some data
_readData($entity, $ids)
Build data array, data is read from cache except iass object itself.
Create styles array
The data for the language used.
+ Here is the call graph for this function:

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