ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
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{
27 public function getSupportedVersions()
28 {
29 return array("4.2.0");
30 }
31
38 function getXmlNamespace($a_entity, $a_schema_version)
39 {
40 return "http://www.ilias.de/xml/Services/COPage/".$a_entity;
41 }
42
49 protected function getTypes($a_entity, $a_version)
50 {
51 // pgtp: page layout template
52 if ($a_entity == "pgtp")
53 {
54 switch ($a_version)
55 {
56 case "4.2.0":
57 return array(
58 "Id" => "integer",
59 "Title" => "text",
60 "Description" => "text",
61 "SpecialPage" => "integer",
62 "StyleId" => "integer");
63 }
64 }
65 }
66
73 function readData($a_entity, $a_version, $a_ids, $a_field = "")
74 {
75 global $ilDB;
76
77 if (!is_array($a_ids))
78 {
79 $a_ids = array($a_ids);
80 }
81
82 // mep_data
83 if ($a_entity == "pgtp")
84 {
85 switch ($a_version)
86 {
87 case "4.2.0":
88 $this->getDirectDataFromQuery("SELECT layout_id id, title, description, ".
89 " style_id, special_page ".
90 " FROM page_layout ".
91 "WHERE ".
92 $ilDB->in("layout_id", $a_ids, false, "integer"));
93 break;
94 }
95 }
96 }
97
101 protected function getDependencies($a_entity, $a_version, $a_rec, $a_ids)
102 {
103 return false;
104 }
105
109
110
117 function importRecord($a_entity, $a_types, $a_rec, $a_mapping, $a_schema_version)
118 {
119 switch ($a_entity)
120 {
121 case "pgtp":
122 include_once("./Services/Style/classes/class.ilPageLayout.php");
123 $pt = new ilPageLayout();
124 $pt->setTitle($a_rec["Title"]);
125 $pt->setDescription($a_rec["Description"]);
126 $pt->setSpecialPage($a_rec["SpecialPage"]);
127 $pt->update();
128
129 $this->current_obj = $pt;
130 $a_mapping->addMapping("Services/COPage", "pgtp", $a_rec["Id"],
131 $pt->getId());
132 $a_mapping->addMapping("Services/COPage", "pg", "stys:".$a_rec["Id"],
133 "stys:".$pt->getId());
134 break;
135 }
136 }
137}
138?>
COPage Data set class.
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.
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...
getDirectDataFromQuery($a_query, $a_convert_to_leading_upper=true)
Get data from query.This is a standard procedure, all db field names are directly mapped to abstract ...
Class ilPageLayout.
global $ilDB