]> git.mxchange.org Git - friendica.git/blobdiff - src/Database/DBA.php
Ops, syntax errors get unnoticed with a simple editor. :-(
[friendica.git] / src / Database / DBA.php
index e44260914eeb20c11c959fa0b000d71277180066..a0eb1c3eceec382ceab0ffeca03f2ff264dcb6d7 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2010-2021, the Friendica project
+ * @copyright Copyright (C) 2010-2022, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
@@ -422,13 +422,14 @@ class DBA
         * @param array         $fields     contains the fields that are updated
         * @param array         $condition  condition array with the key values
         * @param array|boolean $old_fields array with the old field values that are about to be replaced (true = update on duplicate, false = don't update identical fields)
+        * @param array         $params     Parameters: "ignore" If set to "true" then the update is done with the ignore parameter
         *
         * @return boolean was the update successfull?
         * @throws \Exception
         */
-       public static function update($table, $fields, $condition, $old_fields = [])
+       public static function update($table, $fields, $condition, $old_fields = [], $params = [])
        {
-               return DI::dba()->update($table, $fields, $condition, $old_fields);
+               return DI::dba()->update($table, $fields, $condition, $old_fields, $params);
        }
 
        /**
@@ -733,7 +734,7 @@ class DBA
                $order_string = '';
                if (isset($params['order'])) {
                        $order_string = " ORDER BY ";
-                       foreach ($params['order'] AS $fields => $order) {
+                       foreach ($params['order'] as $fields => $order) {
                                if ($order === 'RAND()') {
                                        $order_string .= "RAND(), ";
                                } elseif (!is_int($fields)) {