ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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 
4 include_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  switch ($a_entity) {
137  case "pgtp":
138  include_once("./Services/COPage/Layout/classes/class.ilPageLayout.php");
139  $pt = new ilPageLayout();
140  $pt->setTitle($a_rec["Title"]);
141  $pt->setDescription($a_rec["Description"]);
142  $pt->setSpecialPage($a_rec["SpecialPage"]);
143  $pt->update();
144 
145  $this->current_obj = $pt;
146  $a_mapping->addMapping(
147  "Services/COPage",
148  "pgtp",
149  $a_rec["Id"],
150  $pt->getId()
151  );
152  $a_mapping->addMapping(
153  "Services/COPage",
154  "pg",
155  "stys:" . $a_rec["Id"],
156  "stys:" . $pt->getId()
157  );
158  break;
159  }
160  }
161 }
importRecord($a_entity, $a_types, $a_rec, $a_mapping, $a_schema_version)
Import record.
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 ...
getDependencies($a_entity, $a_version, $a_rec, $a_ids)
Determine the dependent sets of data.
getTypes($a_entity, $a_version)
Get field types for entity.
COPage Data set class.
Class ilPageLayout.
getMasterLanguageOnly()
Get master language only.
readData($a_entity, $a_version, $a_ids, $a_field="")
Read data.
getSupportedVersions()
Get supported versions.
getXmlNamespace($a_entity, $a_schema_version)
Get xml namespace.
A dataset contains in data in a common structure that can be shared and transformed for different pur...
setMasterLanguageOnly($a_val)
Set master language only.