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
// 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]