* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-class User extends BaseUser implements ManageableUser, Registerable {
+class User extends BaseUser implements ManageableUser, Registerable, Updateable {
// Exceptions
const EXCEPTION_USERNAME_NOT_FOUND = 0x150;
const EXCEPTION_USER_EMAIL_NOT_FOUND = 0x151;
* @param $column Column we want to update
* @param $value New value to store in database
* @return void
- * @todo 0% done
+ * @deprecated
*/
public function addUpdateData ($column, $value) {
- $this->partialStub("Column={$column}, value={$value}");
+ $this->deprecatedMethod("Please use updateDatabaseField() instead!");
+ $this->updateDatabaseField($column, $value);
}
/**
$this->getResultInstance()->add2UpdateQueue($updateInstance);
}
- /**
- * Updates a given field with new value
- *
- * @param $fieldName Field to update
- * @param $fieldValue New value to store
- * @return void
- */
- public function updateDatabaseField ($fieldName, $fieldValue) {
- // 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);
- }
-
/**
* Flushs all pending updates to the database layer
*