]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - classes/User.php
updateKeys (for classes with PRI id) now in Managed_DataObject
[quix0rs-gnu-social.git] / classes / User.php
index 242873efe17ba908bb66aac9ac69710b86e68a5b..060a67411d54b68492adf9f229fc2c792ef890a7 100644 (file)
@@ -152,34 +152,6 @@ class User extends Managed_DataObject
         return $this->getProfile()->hasPendingSubscription($other);
     }
 
-    // 'update' won't write key columns, so we have to do it ourselves.
-
-    function updateKeys(&$orig)
-    {
-        $this->_connect();
-        $parts = array();
-        foreach (array('nickname', 'email', 'incomingemail', 'sms', 'carrier', 'smsemail') as $k) {
-            if (strcmp($this->$k, $orig->$k) != 0) {
-                $parts[] = $k . ' = ' . $this->_quote($this->$k);
-            }
-        }
-        if (count($parts) == 0) {
-            // No changes
-            return true;
-        }
-        $toupdate = implode(', ', $parts);
-
-        $table = common_database_tablename($this->tableName());
-        $qry = 'UPDATE ' . $table . ' SET ' . $toupdate .
-          ' WHERE id = ' . $this->id;
-        $orig->decache();
-        $result = $this->query($qry);
-        if ($result) {
-            $this->encache();
-        }
-        return $result;
-    }
-
     /**
      * Get the most recent notice posted by this user, if any.
      *