ILIAS  release_7 Revision v7.30-3-g800a261c036
class.ilCOPageDataSet.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2011 ILIAS open source, Extended GPL, see docs/LICENSE */
3
4include_once("./Services/DataSet/classes/class.ilDataSet.php");
5
20{
21 protected $master_lang_only = false;
22
28 public function setMasterLanguageOnly($a_val)
29 {
30 $this->master_lang_only = $a_val;
31 }
32
38 public function getMasterLanguageOnly()
39 {
41 }
42
49 public function getSupportedVersions()
50 {
51 return array("4.2.0");
52 }
53
60 public function getXmlNamespace($a_entity, $a_schema_version)
61 {
62 return "http://www.ilias.de/xml/Services/COPage/" . $a_entity;
63 }
64
71 protected function getTypes($a_entity, $a_version)
72 {
73 // pgtp: page layout template
74 if ($a_entity == "pgtp") {
75 switch ($a_version) {
76 case "4.2.0":
77 return array(
78 "Id" => "integer",
79 "Title" => "text",
80 "Description" => "text",
81 "SpecialPage" => "integer",
82 "StyleId" => "integer");
83 }
84 }
85 }
86
93 public function readData($a_entity, $a_version, $a_ids, $a_field = "")
94 {
95 $db = $this->db;
96
97 if (!is_array($a_ids)) {
98 $a_ids = array($a_ids);
99 }
100
101 // mep_data
102 if ($a_entity == "pgtp") {
103 switch ($a_version) {
104 case "4.2.0":
105 $this->getDirectDataFromQuery("SELECT layout_id id, title, description, " .
106 " style_id, special_page " .
107 " FROM page_layout " .
108 "WHERE " .
109 $db->in("layout_id", $a_ids, false, "integer"));
110 break;
111 }
112 }
113 }
114
118 protected function getDependencies($a_entity, $a_version, $a_rec, $a_ids)
119 {
120 return false;
121 }
122
126
127
134 public function importRecord($a_entity, $a_types, $a_rec, $a_mapping, $a_schema_version)
135 {
136 $a_rec = $this->stripTags($a_rec);
137 switch ($a_entity) {
138 case "pgtp":
139 include_once("./Services/COPage/Layout/classes/class.ilPageLayout.php");
140 $pt = new ilPageLayout();
141 $pt->setTitle($a_rec["Title"]);
142 $pt->setDescription($a_rec["Description"]);
143 $pt->setSpecialPage($a_rec["SpecialPage"]);
144 $pt->update();
145
146 $this->current_obj = $pt;
147 $a_mapping->addMapping(
148 "Services/COPage",
149 "pgtp",
150 $a_rec["Id"],
151 $pt->getId()
152 );
153 $a_mapping->addMapping(
154 "Services/COPage",
155 "pg",
156 "stys:" . $a_rec["Id"],
157 "stys:" . $pt->getId()
158 );
159 break;
160 }
161 }
162}
An exception for terminatinating execution or to throw for unit testing.
COPage Data set class.
setMasterLanguageOnly($a_val)
Set master language only.
getSupportedVersions()
Get supported versions.
getDependencies($a_entity, $a_version, $a_rec, $a_ids)
Determine the dependent sets of data.
readData($a_entity, $a_version, $a_ids, $a_field="")
Read data.
getTypes($a_entity, $a_version)
Get field types for entity.
getXmlNamespace($a_entity, $a_schema_version)
Get xml namespace.
getMasterLanguageOnly()
Get master language only.
importRecord($a_entity, $a_types, $a_rec, $a_mapping, $a_schema_version)
Import record.
A dataset contains in data in a common structure that can be shared and transformed for different pur...
stripTags(array $rec, array $omit_keys=[])
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 ...
Class ilPageLayout.