]> git.mxchange.org Git - shipsimu.git/blobdiff - inc/classes/main/user/user/class_User.php
Generic methods created from non-generic implementation:
[shipsimu.git] / inc / classes / main / user / user / class_User.php
index 8343c33ebda6dc624c13d3c214a19e02cc7b3a31..8380c857273acd5dc8d750025755ffbf20da2e25 100644 (file)
@@ -21,7 +21,7 @@
  * 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;
@@ -136,10 +136,11 @@ class User extends BaseUser implements ManageableUser, Registerable {
         * @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);
        }
 
        /**
@@ -180,34 +181,6 @@ class User extends BaseUser implements ManageableUser, Registerable {
                $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
         *