]> git.mxchange.org Git - friendica.git/blobdiff - src/Database/DBA.php
NL translation update THX casperrutten33
[friendica.git] / src / Database / DBA.php
index 46bd871b4a748838beeaf04f706b204f6369f6b2..273c87690b45b6b61b2944f3e7cc7e6cdd94fef0 100644 (file)
@@ -292,6 +292,21 @@ class DBA
                return DI::dba()->insert($table, $param, $on_duplicate_update);
        }
 
+       /**
+        * Inserts a row with the provided data in the provided table.
+        * If the data corresponds to an existing row through a UNIQUE or PRIMARY index constraints, it updates the row instead.
+        *
+        * @param string|array $table Table name or array [schema => table]
+        * @param array        $param parameter array
+        *
+        * @return boolean was the insert successful?
+        * @throws \Exception
+        */
+       public static function replace($table, $param)
+       {
+               return DI::dba()->replace($table, $param);
+       }
+
        /**
         * Fetch the id of the last insert command
         *