Esempio n. 1
0
 /**
  * @author WN
  * @param string $name
  * @param array $arguments
  * @return $this
  */
 public function __call($name, $arguments)
 {
     $action = substr($name, 0, 3);
     $property = NameHelper::camelToSnake(substr($name, 3));
     if ($this->isPropertyAllowed($property)) {
         switch ($action) {
             case 'set':
                 return $this->set($property, $arguments);
             case 'get':
                 return $this->get($property);
             case 'add':
                 return $this->add($property, $arguments);
         }
     }
     throw new \RuntimeException('Call to undefined method ' . __CLASS__ . '::' . $name . '()');
 }