Elgg  Version 1.11
ClassMap.php
Go to the documentation of this file.
1 <?php
2 namespace Elgg;
11 class ClassMap {
12 
16  protected $map = array();
17 
21  protected $altered = false;
22 
29  public function getPath($class) {
30  if ('\\' === $class[0]) {
31  $class = substr($class, 1);
32  }
33  return isset($this->map[$class]) ? $this->map[$class] : "";
34  }
35 
43  public function setPath($class, $path) {
44  if ('\\' === $class[0]) {
45  $class = substr($class, 1);
46  }
47  $this->map[$class] = $path;
48  $this->altered = true;
49  return $this;
50  }
51 
57  public function getAltered() {
58  return $this->altered;
59  }
60 
67  public function setAltered($altered) {
68  $this->altered = (bool) $altered;
69  return $this;
70  }
71 
77  public function getMap() {
78  return $this->map;
79  }
80 
88  public function setMap(array $map) {
89  $this->map = $map;
90  return $this;
91  }
92 
100  public function mergeMap(array $map) {
101  $this->map = array_merge($this->map, $map);
102  return $this;
103  }
104 }
105 
getAltered()
Was this map altered by the class loader?
Definition: ClassMap.php:57
setMap(array $map)
Set the full map.
Definition: ClassMap.php:88
getMap()
Get the full map.
Definition: ClassMap.php:77
getPath($class)
Get the path for a class/interface/trait.
Definition: ClassMap.php:29
mergeMap(array $map)
Merge a class map with the current map.
Definition: ClassMap.php:100
if(isset($vars['id'])) $class
Definition: ajax_loader.php:19
setAltered($altered)
Set the altered flag.
Definition: ClassMap.php:67
Save menu items.
setPath($class, $path)
Set the path for a class/interface/trait, and mark map as altered.
Definition: ClassMap.php:43
$path
Definition: invalid.php:17