ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilRatingDataSet Class Reference

Rating Data set class. More...

+ Inheritance diagram for ilRatingDataSet:
+ Collaboration diagram for ilRatingDataSet:

Public Member Functions

 getSupportedVersions ()
 Get supported versions. More...
 
 getXmlNamespace ($a_entity, $a_schema_version)
 Get xml namespace. More...
 
 readData ($a_entity, $a_version, $a_ids, $a_field="")
 Read data. More...
 
 importRecord ($a_entity, $a_types, $a_rec, $a_mapping, $a_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 ($a_entity, $a_version)
 Get field types for entity. More...
 
 getDependencies ($a_entity, $a_version, $a_rec, $a_ids)
 Determine the dependent sets of data. 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

Rating Data set class.

This class implements the following entities:

  • rating_category: data from il_rating_cat
Author
Jörg Lützenkirchen luetz.nosp@m.enki.nosp@m.rchen.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Version
$Id$

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

Member Function Documentation

◆ getDependencies()

ilRatingDataSet::getDependencies (   $a_entity,
  $a_version,
  $a_rec,
  $a_ids 
)
protected

Determine the dependent sets of data.

Definition at line 90 of file class.ilRatingDataSet.php.

91  {
92  return false;
93  }

◆ getSupportedVersions()

ilRatingDataSet::getSupportedVersions ( )

Get supported versions.

Parameters

Definition at line 24 of file class.ilRatingDataSet.php.

25  {
26  return array("4.3.0");
27  }

◆ getTypes()

ilRatingDataSet::getTypes (   $a_entity,
  $a_version 
)
protected

Get field types for entity.

Parameters

Definition at line 46 of file class.ilRatingDataSet.php.

47  {
48  if ($a_entity == "rating_category") {
49  switch ($a_version) {
50  case "4.3.0":
51  return array(
52  "Id" => "integer",
53  "ParentId" => "integer",
54  "Title" => "text",
55  "Description" => "text",
56  "Pos" => "integer");
57  }
58  }
59  }

◆ getXmlNamespace()

ilRatingDataSet::getXmlNamespace (   $a_entity,
  $a_schema_version 
)

Get xml namespace.

Parameters

Definition at line 35 of file class.ilRatingDataSet.php.

36  {
37  return "http://www.ilias.de/xml/Services/Rating/" . $a_entity;
38  }

◆ importRecord()

ilRatingDataSet::importRecord (   $a_entity,
  $a_types,
  $a_rec,
  $a_mapping,
  $a_schema_version 
)

Import record.

Parameters

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

102  {
103  //echo $a_entity;
104  //var_dump($a_rec);
105 
106  switch ($a_entity) {
107  case "rating_category":
108  if ($parent_id = $a_mapping->getMapping('Services/Rating', 'rating_category_parent_id', $a_rec['ParentId'])) {
109  include_once("./Services/Rating/classes/class.ilRatingCategory.php");
110  $newObj = new ilRatingCategory();
111  $newObj->setParentId($parent_id);
112  $newObj->save();
113 
114  $newObj->setTitle($a_rec["Title"]);
115  $newObj->setDescription($a_rec["Description"]);
116  $newObj->setPosition($a_rec["Pos"]);
117  $newObj->update();
118  }
119  break;
120  }
121  }
Class ilRatingCategory.

◆ readData()

ilRatingDataSet::readData (   $a_entity,
  $a_version,
  $a_ids,
  $a_field = "" 
)

Read data.

Parameters

Definition at line 67 of file class.ilRatingDataSet.php.

References ilDataSet\$db, $ilDB, and ilDataSet\getDirectDataFromQuery().

68  {
69  $ilDB = $this->db;
70 
71  if (!is_array($a_ids)) {
72  $a_ids = array($a_ids);
73  }
74 
75  if ($a_entity == "rating_category") {
76  switch ($a_version) {
77  case "4.3.0":
78  $this->getDirectDataFromQuery("SELECT id, parent_id, title," .
79  " description, pos" .
80  " FROM il_rating_cat" .
81  " WHERE " . $ilDB->in("parent_id", $a_ids, false, "integer"));
82  break;
83  }
84  }
85  }
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 ...
global $ilDB
+ Here is the call graph for this function:

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