public function setValue($key, $value) { $method = "set" . $key; if (method_exists($this, $method)) { $this->{$method}($value); } return $this; }