public function offsetGet($offset) { if (null !== $offset) { $getter = 'get' . ucfirst($offset); if (is_callable(array($this, $getter . 'Array'))) { $getter .= 'Array'; } if (is_callable(array($this, $getter))) { return $this->{$getter}(); } } }