Updating/inserting points finished (basicly), flushing needed database updates moved...
[core.git] / inc / classes / main / user / member / class_Member.php
index b67ad88b9274bbc1f2ebc48759a49ab2ac47663f..f5bf2e8889f4968d8d5792d7da6ff6913fa7f518 100644 (file)
@@ -32,19 +32,6 @@ class Member extends BaseUser implements ManageableMember, Registerable, Updatea
                parent::__construct(__CLASS__);
        }
 
-       /**
-        * Destructor to always flush updates
-        *
-        * @return      void
-        */
-       public function __destruct () {
-               // Flush any updated entries to the database
-               $this->flushPendingUpdates();
-
-               // Call parent destructor
-               parent::__destruct();
-       }
-
        /**
         * Creates an instance of this user class by a provided username. This
         * factory method will check if username is already taken and if not so it
@@ -150,25 +137,12 @@ class Member extends BaseUser implements ManageableMember, Registerable, Updatea
                // Add the search criteria for searching for the right entry
                $updateInstance->setSearchInstance($searchInstance);
 
+               // Set wrapper class name
+               $updateInstance->setWrapperConfigEntry('user_db_wrapper_class');
+
                // Remember the update in database result
                $this->getResultInstance()->add2UpdateQueue($updateInstance);
        }
-
-       /**
-        * Flushs all pending updates to the database layer
-        *
-        * @return      void
-        */
-       public function flushPendingUpdates () {
-               // Do we have data to update?
-               if ($this->getResultInstance()->ifDataNeedsFlush()) {
-                       // Get a database wrapper
-                       $wrapperInstance = ObjectFactory::createObjectByConfiguredName('user_db_wrapper_class');
-
-                       // Yes, then send the whole result to the database layer
-                       $wrapperInstance->doUpdateByResult($this->getResultInstance());
-               } // END - if
-       }
 }
 
 // [EOF]