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