ILIAS  release_8 Revision v8.24
class.ilRatingDataSet.php
Go to the documentation of this file.
1<?php
2
28{
29 public function getSupportedVersions(): array
30 {
31 return array("4.3.0");
32 }
33
37 protected function getXmlNamespace(string $a_entity, string $a_schema_version): string
38 {
39 return "https://www.ilias.de/xml/Services/Rating/" . $a_entity;
40 }
41
45 protected function getTypes(string $a_entity, string $a_version): array
46 {
47 if ($a_entity == "rating_category") {
48 switch ($a_version) {
49 case "4.3.0":
50 return array(
51 "Id" => "integer",
52 "ParentId" => "integer",
53 "Title" => "text",
54 "Description" => "text",
55 "Pos" => "integer");
56 }
57 }
58 return [];
59 }
60
64 public function readData(string $a_entity, string $a_version, array $a_ids): void
65 {
67
68 if (!is_array($a_ids)) {
69 $a_ids = array($a_ids);
70 }
71
72 if ($a_entity == "rating_category") {
73 switch ($a_version) {
74 case "4.3.0":
75 $this->getDirectDataFromQuery("SELECT id, parent_id, title," .
76 " description, pos" .
77 " FROM il_rating_cat" .
78 " WHERE " . $ilDB->in("parent_id", $a_ids, false, "integer"));
79 break;
80 }
81 }
82 }
83
84 protected function getDependencies(
85 string $a_entity,
86 string $a_version,
87 ?array $a_rec = null,
88 ?array $a_ids = null
89 ): array {
90 return [];
91 }
92
93 public function importRecord(
94 string $a_entity,
95 array $a_types,
96 array $a_rec,
97 ilImportMapping $a_mapping,
98 string $a_schema_version
99 ): void {
100 $a_rec = $this->stripTags($a_rec);
101 switch ($a_entity) {
102 case "rating_category":
103 if ($parent_id = $a_mapping->getMapping('Services/Rating', 'rating_category_parent_id', $a_rec['ParentId'])) {
104 $newObj = new ilRatingCategory();
105 $newObj->setParentId($parent_id);
106 $newObj->save();
107
108 $newObj->setTitle($a_rec["Title"]);
109 $newObj->setDescription($a_rec["Description"]);
110 $newObj->setPosition($a_rec["Pos"]);
111 $newObj->update();
112 }
113 break;
114 }
115 }
116}
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getDirectDataFromQuery(string $a_query, bool $a_convert_to_leading_upper=true, bool $a_set=true)
Get data from query.This is a standard procedure, all db field names are directly mapped to abstract ...
ilDBInterface $db
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getMapping(string $a_comp, string $a_entity, string $a_old_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getXmlNamespace(string $a_entity, string $a_schema_version)
@inheritDoc
getDependencies(string $a_entity, string $a_version, ?array $a_rec=null, ?array $a_ids=null)
getTypes(string $a_entity, string $a_version)
@inheritDoc
importRecord(string $a_entity, array $a_types, array $a_rec, ilImportMapping $a_mapping, string $a_schema_version)
Needs to be overwritten for import use case.
readData(string $a_entity, string $a_version, array $a_ids)
@inheritDoc
return['3gp', '7z', 'ai', 'aif', 'aifc', 'aiff', 'au', 'arw', 'avi', 'backup', 'bak', 'bas', 'bpmn', 'bpmn2', 'bmp', 'bib', 'bibtex', 'bz', 'bz2', 'c', 'c++', 'cc', 'cct', 'cdf', 'cer', 'class', 'cls', 'conf', 'cpp', 'crt', 'crs', 'crw', 'cr2', 'css', 'cst', 'csv', 'cur', 'db', 'dcr', 'des', 'dng', 'doc', 'docx', 'dot', 'dotx', 'dtd', 'dvi', 'el', 'eps', 'epub', 'f', 'f77', 'f90', 'flv', 'for', 'g3', 'gif', 'gl', 'gan', 'ggb', 'gsd', 'gsm', 'gtar', 'gz', 'gzip', 'h', 'hpp', 'htm', 'html', 'htmls', 'ibooks', 'ico', 'ics', 'ini', 'ipynb', 'java', 'jbf', 'jpeg', 'jpg', 'js', 'jsf', 'jso', 'json', 'latex', 'lang', 'less', 'log', 'lsp', 'ltx', 'm1v', 'm2a', 'm2v', 'm3u', 'm4a', 'm4v', 'markdown', 'm', 'mat', 'md', 'mdl', 'mdown', 'mid', 'min', 'midi', 'mobi', 'mod', 'mov', 'movie', 'mp2', 'mp3', 'mp4', 'mpa', 'mpeg', 'mpg', 'mph', 'mpga', 'mpp', 'mpt', 'mpv', 'mpx', 'mv', 'mw', 'mv4', 'nb', 'nbp', 'nef', 'nif', 'niff', 'obj', 'obm', 'odt', 'ods', 'odp', 'odg', 'odf', 'oga', 'ogg', 'ogv', 'old', 'p', 'pas', 'pbm', 'pcl', 'pct', 'pcx', 'pdf', 'pgm', 'pic', 'pict', 'png', 'por', 'pov', 'project', 'properties', 'ppa', 'ppm', 'pps', 'ppsx', 'ppt', 'pptx', 'ppz', 'ps', 'psd', 'pwz', 'qt', 'qtc', 'qti', 'qtif', 'r', 'ra', 'ram', 'rar', 'rast', 'rda', 'rev', 'rexx', 'ris', 'rf', 'rgb', 'rm', 'rmd', 'rmi', 'rmm', 'rmp', 'rt', 'rtf', 'rtx', 'rv', 's', 's3m', 'sav', 'sbs', 'sec', 'sdml', 'sgm', 'sgml', 'smi', 'smil', 'srt', 'sps', 'spv', 'stl', 'svg', 'swa', 'swf', 'swz', 'tar', 'tex', 'texi', 'texinfo', 'text', 'tgz', 'tif', 'tiff', 'ttf', 'txt', 'tmp', 'uvproj', 'vdf', 'vimeo', 'viv', 'vivo', 'vrml', 'vsdx', 'wav', 'webm', 'wmv', 'wmx', 'wmz', 'woff', 'wwd', 'xhtml', 'xif', 'xls', 'xlsx', 'xmind', 'xml', 'xsl', 'xsd', 'zip']