ILIAS  release_8 Revision v8.24
class.ilCOPageDataSet.php
Go to the documentation of this file.
1<?php
2
29{
31 protected bool $master_lang_only = false;
32
33 public function setMasterLanguageOnly(bool $a_val): void
34 {
35 $this->master_lang_only = $a_val;
36 }
37
38 public function getMasterLanguageOnly(): bool
39 {
41 }
42
43 public function getSupportedVersions(): array
44 {
45 return array("4.2.0");
46 }
47
48 protected function getXmlNamespace(string $a_entity, string $a_schema_version): string
49 {
50 return "https://www.ilias.de/xml/Services/COPage/" . $a_entity;
51 }
52
53 protected function getTypes(string $a_entity, string $a_version): array
54 {
55 // pgtp: page layout template
56 if ($a_entity == "pgtp") {
57 switch ($a_version) {
58 case "4.2.0":
59 return array(
60 "Id" => "integer",
61 "Title" => "text",
62 "Description" => "text",
63 "SpecialPage" => "integer",
64 "StyleId" => "integer");
65 }
66 }
67 return [];
68 }
69
70 public function readData(string $a_entity, string $a_version, array $a_ids): void
71 {
72 $db = $this->db;
73
74 if (!is_array($a_ids)) {
75 $a_ids = array($a_ids);
76 }
77
78 // mep_data
79 if ($a_entity == "pgtp") {
80 switch ($a_version) {
81 case "4.2.0":
82 $this->getDirectDataFromQuery("SELECT layout_id id, title, description, " .
83 " style_id, special_page " .
84 " FROM page_layout " .
85 "WHERE " .
86 $db->in("layout_id", $a_ids, false, "integer"));
87 break;
88 }
89 }
90 }
91
95 protected function getDependencies(
96 string $a_entity,
97 string $a_version,
98 ?array $a_rec = null,
99 ?array $a_ids = null
100 ): array {
101 return [];
102 }
103
104 public function importRecord(string $a_entity, array $a_types, array $a_rec, ilImportMapping $a_mapping, string $a_schema_version): void
105 {
106 $a_rec = $this->stripTags($a_rec);
107 switch ($a_entity) {
108 case "pgtp":
109 $pt = new ilPageLayout();
110 $pt->setTitle($a_rec["Title"]);
111 $pt->setDescription($a_rec["Description"]);
112 $pt->setSpecialPage($a_rec["SpecialPage"]);
113 $pt->update();
114
115 $this->current_obj = $pt;
116 $a_mapping->addMapping(
117 "Services/COPage",
118 "pgtp",
119 $a_rec["Id"],
120 $pt->getId()
121 );
122 $a_mapping->addMapping(
123 "Services/COPage",
124 "pg",
125 "stys:" . $a_rec["Id"],
126 "stys:" . $pt->getId()
127 );
128 break;
129 }
130 }
131}
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)
getTypes(string $a_entity, string $a_version)
Get (abstract) types for (abstract) field names.
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.
getDependencies(string $a_entity, string $a_version, ?array $a_rec=null, ?array $a_ids=null)
Determine the dependent sets of data.
readData(string $a_entity, string $a_version, array $a_ids)
Read data from DB.
setMasterLanguageOnly(bool $a_val)
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...
addMapping(string $a_comp, string $a_entity, string $a_old_id, string $a_new_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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']
in(string $field, array $values, bool $negate=false, string $type="")