// "Insert" this request instance completely into the database
$this->getDatabaseInstance()->queryInsertDataSet($dataSetInstance);
}
+
+ /**
+ * Updates an user database entry with given result
+ *
+ * @param $resultInstance An instance of a Updateable database result
+ * @return void
+ */
+ public function doUpdateByResult (UpdateableResult $resultInstance) {
+ // Generate a data set object
+ $dataSetInstance = ObjectFactory::createObjectByConfiguredName('dataset_criteria_class');
+ $dataSetInstance->setTableName(self::DB_TABLE_USER);
+
+ // Add all update criteria to the database set
+ $resultInstance->addElementsToDataSet($dataSetInstance);
+
+ // Add seach criteria
+ $dataSetInstance->setSearchInstance($resultInstance->getSearchInstance());
+
+ // Add the primary key
+ $dataSetInstance->setUniqueKey('username');
+
+ // "Update" this request with the database
+ $this->getDatabaseInstance()->queryUpdateDataSet($dataSetInstance);
+ }
}
// [EOF]