ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
class.ilImportMapping.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2010 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
12 {
13  var $mappings;
16  var $log;
17 
18  protected $target_id = 0;
19 
26  function __construct()
27  {
28  $this->mappings = array();
29  $this->log = ilLoggerFactory::getLogger("exp");
30  $this->log->debug("ilImportMapping Construct this->mappings = array()");
31  }
32 
38  final function setInstallId($a_val)
39  {
40  $this->install_id = $a_val;
41  }
42 
48  final function getInstallId()
49  {
50  return $this->install_id;
51  }
52 
58  final function setInstallUrl($a_val)
59  {
60  $this->install_url = $a_val;
61  }
62 
68  final function getInstallUrl()
69  {
70  return $this->install_url;
71  }
72 
78  public final function setTargetId($a_target_id)
79  {
80  $this->target_id = $a_target_id;
81  $this->log->debug("a_target_id=".$a_target_id);
82  }
83 
88  public final function getTargetId()
89  {
90  return $this->target_id;
91  }
92 
101  function addMapping($a_comp, $a_entity, $a_old_id, $a_new_id)
102  {
103  $this->mappings[$a_comp][$a_entity][$a_old_id] = $a_new_id;
104  $this->log->debug("ADD MAPPING this->mappings = ", $this->mappings);
105  }
106 
116  function getMapping($a_comp, $a_entity, $a_old_id)
117  {
118  $this->log->debug("a_comp = $a_comp, a_entity = $a_entity , a_old_id = $a_old_id");
119 
120  if(!isset ($this->mappings[$a_comp]) or !isset ($this->mappings[$a_comp][$a_entity]))
121  {
122  return false;
123  }
124  if (isset($this->mappings[$a_comp][$a_entity][$a_old_id]))
125  {
126  return $this->mappings[$a_comp][$a_entity][$a_old_id];
127  }
128 
129  return false;
130  }
131 
137  function getAllMappings()
138  {
139  return $this->mappings;
140  }
141 
149  function getMappingsOfEntity($a_comp, $a_entity)
150  {
151  if (isset($this->mappings[$a_comp][$a_entity]))
152  {
153  return $this->mappings[$a_comp][$a_entity];
154  }
155  return array();
156  }
157 
158 }
159 ?>
getMapping($a_comp, $a_entity, $a_old_id)
Get a mapping.
getAllMappings()
Get mapping.
setInstallUrl($a_val)
Set Installation Url.
setInstallId($a_val)
Set Installation ID.
getInstallUrl()
Get Installation Url.
setTargetId($a_target_id)
set target id
__construct()
Constructor.
addMapping($a_comp, $a_entity, $a_old_id, $a_new_id)
Add mapping.
getTargetId()
get target id
Create styles array
The data for the language used.
getInstallId()
Get Installation ID.
getMappingsOfEntity($a_comp, $a_entity)
Get mappings for entity.
static getLogger($a_component_id)
Get component logger.