]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - classes/Managed_DataObject.php
updateKeys -> updateWithKeys (w/ functionality)
[quix0rs-gnu-social.git] / classes / Managed_DataObject.php
index d20d3cc27ea2dc65f17036ec0aee4820ce72cd63..8428d11dcbf8578f90500f92917fcd053d441157 100644 (file)
@@ -322,13 +322,16 @@ abstract class Managed_DataObject extends Memcached_DataObject
     }
 
     // 'update' won't write key columns, so we have to do it ourselves.
-    public function updateKeys(&$orig)
+    // This also automatically calls "update" _before_ it sets the keys.
+    public function updateWithKeys(&$orig)
     {
         if (!$orig instanceof $this) {
             throw new ServerException('Tried updating a DataObject with a different class than itself.');
         }
 
-        $this->_connect();
+        // Update non-keys first, if necessary.
+        $this->update($orig);
+
         $parts = array();
         foreach ($this->keys() as $k) {
             if (strcmp($this->$k, $orig->$k) != 0) {