X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FDatabase%2FDBA.php;h=784815f181e774fa07534bef5af3a53f7af56d27;hb=8d550ad4e8d7571d2b635a47d4f8f2640b4c4354;hp=1a7ff3bc541cf2a82e117f00a06d3263f2a1729a;hpb=bd9f36622e056c83e8bfef2920640285ce9672b0;p=friendica.git diff --git a/src/Database/DBA.php b/src/Database/DBA.php index 1a7ff3bc54..784815f181 100644 --- a/src/Database/DBA.php +++ b/src/Database/DBA.php @@ -1,6 +1,6 @@ table] * @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) + * @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) * * @return boolean was the update successfull? * @throws \Exception @@ -478,7 +475,7 @@ class DBA * @return boolean|object * * Example: - * $table = "item"; + * $table = "post"; * $fields = array("id", "uri", "uid", "network"); * * $condition = array("uid" => 1, "network" => 'dspr'); @@ -505,7 +502,7 @@ class DBA * @return int * * Example: - * $table = "item"; + * $table = "post"; * * $condition = ["uid" => 1, "network" => 'dspr']; * or: @@ -736,7 +733,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)) { @@ -767,13 +764,15 @@ class DBA /** * Fills an array with data from a query * - * @param object $stmt statement object - * @param bool $do_close + * @param object $stmt statement object + * @param bool $do_close Close database connection after last row + * @param int $count maximum number of rows to be fetched + * * @return array Data array */ - public static function toArray($stmt, $do_close = true) + public static function toArray($stmt, $do_close = true, int $count = 0) { - return DI::dba()->toArray($stmt, $do_close); + return DI::dba()->toArray($stmt, $do_close, $count); } /**