// Return the value
return $primaryValue;
}
+
+ /**
+ * Updates a given field with new value
+ *
+ * @param $fieldName Field to update
+ * @param $fieldValue New value to store
+ * @return void
+ * @throws DatabaseUpdateSupportException If this class does not support database updates
+ */
+ public function updateDatabaseField ($fieldName, $fieldValue) {
+ // Is updating database fields allowed by interface?
+ if (!$this instanceof Updateable) {
+ // Update not supported!
+ throw new DatabaseUpdateSupportException($this, self::EXCEPTION_DATABASE_UPDATED_NOT_ALLOWED);
+ } // END - if
+
+ // Get a critieria instance
+ $searchInstance = ObjectFactory::createObjectByConfiguredName('search_criteria_class');
+
+ // Add search criteria
+ $searchInstance->addCriteria(UserDatabaseWrapper::DB_COLUMN_USERNAME, $this->getUserName());
+ $searchInstance->setLimit(1);
+
+ // Now get another criteria
+ $updateInstance = ObjectFactory::createObjectByConfiguredName('update_criteria_class');
+
+ // And add our both entries
+ $updateInstance->addCriteria($fieldName, $fieldValue);
+
+ // Add the search criteria for searching for the right entry
+ $updateInstance->setSearchInstance($searchInstance);
+
+ // Remember the update in database result
+ $this->getResultInstance()->add2UpdateQueue($updateInstance);
+ }
}
// [EOF]