Ejemplo n.º 1
0
 /**
  * Proxies getPerson()->$method as getPersonMethod in current object. Only for getters
  *
  * @param string $method
  * @param <type> $arguments
  * @return <type>
  */
 public function __call($method, $arguments)
 {
     if (preg_match('/^getPerson(.*)/', $method, $matches) && isset($matches[1])) {
         $method = "get" . $matches[1];
         return $this->getPerson()->{$method}();
     }
     if (preg_match('/^canPersonBe(.*)/', $method, $matches) && isset($matches[1])) {
         $method = "canBe" . $matches[1];
         return $this->getPerson()->{$method}();
     }
     parent::__call($method, $arguments);
 }