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