nyroFwk  0.2
proxy.class.php
Go to the documentation of this file.
1 <?php
10 class response_proxy extends object {
11 
17  protected $call = array();
18 
24  private $response;
25 
31  protected $isResponseProxy;
32 
33  protected function afterInit() {
35  $this->isResponseProxy = ($this->response instanceof response_proxy);
36  }
37 
43  public function hasCall() {
44  return !empty($this->call);
45  }
46 
52  public function getCall() {
53  return $this->call;
54  }
55 
59  public function initCall() {
60  $this->call = array();
61  }
62 
68  public function doCalls(array $calls) {
69  foreach($calls as $c) {
70  call_user_func_array(array($this->response, $c[0]), $c[1]);
71  }
72  }
73 
74  public function getAttr($name) {
75  return $this->response->getAttr($name);
76  }
77 
78  public function setAttr($name, $value) {
79  $this->call[] = array('setAttr', array($name, $value));
80  $this->response->setAttr($name, $value);
81  parent::setAttr($name, $value);
82  }
83 
91  public function __call($name, $prm) {
92  if (!$this->isResponseProxy && substr($name, 0, 3) != 'get')
93  $this->call[] = array($name, $prm);
94  return call_user_func_array(array($this->response, $name), $prm);
95  }
96 
97  public function __toString() {
98  return '';
99  }
100 
101 }
__call($name, $prm)
Definition: proxy.class.php:91
static getInstance()
setAttr($name, $value)
Definition: proxy.class.php:78
doCalls(array $calls)
Definition: proxy.class.php:68
Generated on Sun Oct 15 2017 22:25:20 for nyroFwk by doxygen 1.8.13