ACL Extension  0.3
 All Data Structures Namespaces Files Functions Variables
HiddenClass.php
Go to the documentation of this file.
1 <?php
14 
15  protected $class = NULL;
16  protected $obj = NULL;
17 
18  public function __construct($className, $originalArguments){
19  $this->class = $className;
20  $this->instantiateClass($originalArguments);
21  }
22 
23  public function instantiateClass($arg){
24 
25  switch(count($arg)){
26  case 0:
27  $this->obj = new $this->class();
28  break;
29  case 1:
30  $this->obj = new $this->class($arg[0]);
31  break;
32  case 2:
33  $this->obj = new $this->class($arg[1]);
34  break;
35  case 3:
36  $this->obj = new $this->class($arg[2]);
37  break;
38  default:
39  throw new RuntimeException('Please expand this function yourself :)');
40  break;
41  }
42  }
43 
44  public function pretends(){
45  return $this->class;
46  }
47 
48  public function __call($funcName, $args){
49  return call_user_func_array(array($this->obj, $funcName), $args);
50  }
51 
52  public function __get($name) {
53  return $this->obj->{$name};
54  }
55 
56  public function __set($key, $val){
57  return $this->obj->{$key} = $val;
58  }
59 
60  public function __isset($key){
61  return isset($this->obj->{$key});
62  }
63 
64  public function __unset($key){
65  return $this->obj->{$key};
66  }
67 
68 }
69 
70 ?>