Esempio n. 1
0
 public function __call($method, $args)
 {
     $prop = mb_strtolower(mb_substr($method, 3, 1)) . mb_substr($method, 4);
     // ucfirst in mb_string
     /* getter der nicht implementiert ist */
     if (mb_strpos($method, 'get') === 0) {
         if ($this->annotationClass->hasProperty($prop)) {
             return $this->annotation->{$prop};
         } else {
             throw new MissingPropertyException($prop, 'Annotation: ' . $this->annotationClass->getFQN() . " hat kein Feld '" . $prop . "'");
         }
     }
     /* setter der nicht implementiert ist */
     if (mb_strpos($method, 'set') === 0) {
         if ($this->annotationClass->hasProperty($prop)) {
             $this->annotation->{$prop} = $args[0];
             return $this;
         } else {
             throw new MissingPropertyException($prop, 'Annotation: ' . $this->annotationClass->getFQN() . " hat kein Feld '" . $prop . "'");
         }
     }
     throw new \BadMethodCallException('Call to undefined method ' . get_class($this) . '::' . $method . '()');
 }