public function __get($name) { $params = $this->toArray(); if (array_key_exists($name, $params)) { return $params[$name]; } }