public function fromArray(array $data) { foreach ($data as $key => $value) { $this->{'set' . $key}($value); } }