]> git.mxchange.org Git - shipsimu.git/blobdiff - inc/classes/main/database/wrapper/class_UserDatabaseWrapper.php
Update of last activitity and action in user added, refresh of auth cookies added
[shipsimu.git] / inc / classes / main / database / wrapper / class_UserDatabaseWrapper.php
index 5fc62e2a836a0a2fd32fb9ea2d8bcf6d676d0711..e2ff935633930c99f6a86ba8a3b271ef2d6d5887 100644 (file)
@@ -141,6 +141,30 @@ class UserDatabaseWrapper extends BaseDatabaseWrapper {
                // "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]