public function __call($method, $args)
{
switch (substr($method, 0, 3)) {
case 'get':
$key = $this->underscore(substr($method, 3));
$data = $this->getData($key, isset($args[0]) ? $args[0] : null);
return $data;
case 'set':
$key = $this->underscore(substr($method, 3));
$result = $this->setData($key, isset($args[0]) ? $args[0] : null);
return $result;
case 'uns':
$key = $this->underscore(substr($method, 3));
$result = $this->unsetData($key);
return $result;
case 'has':
$key = $this->underscore(substr($method, 3));
return isset($this->data[$key]);
}
throw new \Gc\Exception('Invalid method ' . get_class($this) . '::' . $method . '(' . print_r($args, true) . ')');
}