]> git.mxchange.org Git - friendica.git/commitdiff
Rename DBA::fetch_first to DBA::fetchFirst
authorHypolite Petovan <mrpetovan@gmail.com>
Sat, 21 Jul 2018 02:01:53 +0000 (22:01 -0400)
committerHypolite Petovan <mrpetovan@gmail.com>
Sun, 22 Jul 2018 23:27:34 +0000 (19:27 -0400)
12 files changed:
mod/dfrn_notify.php
mod/directory.php
mod/display.php
src/App.php
src/Content/ContactSelector.php
src/Core/Worker.php
src/Database/DBA.php
src/Model/Contact.php
src/Model/Item.php
src/Model/Profile.php
src/Model/User.php
src/Worker/Delivery.php

index 726f8335db4f76336cf405af2be653f4f530cfa2..08c43d0fbf2a4c805f13e7f49412368e47d45997 100644 (file)
@@ -213,7 +213,7 @@ function dfrn_dispatch_public($postdata)
        }
 
        // We now have some contact, so we fetch it
-       $importer = DBA::fetch_first("SELECT *, `name` as `senderName`
+       $importer = DBA::fetchFirst("SELECT *, `name` as `senderName`
                                        FROM `contact`
                                        WHERE NOT `blocked` AND `id` = ? LIMIT 1",
                                        $contact['id']);
@@ -252,7 +252,7 @@ function dfrn_dispatch_private($user, $postdata)
        }
 
        // We now have some contact, so we fetch it
-       $importer = DBA::fetch_first("SELECT *, `name` as `senderName`
+       $importer = DBA::fetchFirst("SELECT *, `name` as `senderName`
                                        FROM `contact`
                                        WHERE NOT `blocked` AND `id` = ? LIMIT 1",
                                        $cid);
index 2f5d364e911ad864918654bdbc41f4f3ef969d28..08354e3a90b5a103643a3e62817d8150c7180689 100644 (file)
@@ -83,7 +83,7 @@ function directory_content(App $a)
        $publish = (Config::get('system', 'publish_all') ? '' : " AND `publish` = 1 " );
 
 
-       $cnt = DBA::fetch_first("SELECT COUNT(*) AS `total` FROM `profile`
+       $cnt = DBA::fetchFirst("SELECT COUNT(*) AS `total` FROM `profile`
                                LEFT JOIN `user` ON `user`.`uid` = `profile`.`uid`
                                WHERE `is-default` $publish AND NOT `user`.`blocked` AND NOT `user`.`account_removed` $sql_extra");
        if (DBM::is_result($cnt)) {
index e615b68437b45fd8c9d44a8ae0b5a70e277812e8..98478024f6dce380d16d7a1fb7d6a1547ebc71d9 100644 (file)
@@ -87,7 +87,7 @@ function display_init(App $a)
                $nickname = str_replace(normalise_link(System::baseUrl())."/profile/", "", normalise_link($profiledata["url"]));
 
                if (($nickname != $a->user["nickname"])) {
-                       $profile = DBA::fetch_first("SELECT `profile`.`uid` AS `profile_uid`, `profile`.* , `contact`.`avatar-date` AS picdate, `user`.* FROM `profile`
+                       $profile = DBA::fetchFirst("SELECT `profile`.`uid` AS `profile_uid`, `profile`.* , `contact`.`avatar-date` AS picdate, `user`.* FROM `profile`
                                INNER JOIN `contact` on `contact`.`uid` = `profile`.`uid` INNER JOIN `user` ON `profile`.`uid` = `user`.`uid`
                                WHERE `user`.`nickname` = ? AND `profile`.`is-default` AND `contact`.`self` LIMIT 1",
                                $nickname
index 1e24c3214f7030130060b0a620499fff45e57380..815b583c38b5ba72b9b654f06933b202dbf8209e 100644 (file)
@@ -496,7 +496,7 @@ class App
 
                $this->mode |= App::MODE_DBAVAILABLE;
 
-               if (DBA::fetch_first("SHOW TABLES LIKE 'config'") === false) {
+               if (DBA::fetchFirst("SHOW TABLES LIKE 'config'") === false) {
                        return;
                }
 
index 797ec78610a01010a039473e886a41ca9cb4f1b0..64b6ca7c6e8f39d0f040570765a3aaf655c3aa5b 100644 (file)
@@ -102,7 +102,7 @@ class ContactSelector
                $networkname = str_replace($search, $replace, $s);
 
                if ((in_array($s, [NETWORK_DFRN, NETWORK_DIASPORA, NETWORK_OSTATUS])) && ($profile != "")) {
-                       $r = DBA::fetch_first("SELECT `gserver`.`platform` FROM `gcontact`
+                       $r = DBA::fetchFirst("SELECT `gserver`.`platform` FROM `gcontact`
                                        INNER JOIN `gserver` ON `gserver`.`nurl` = `gcontact`.`server_url`
                                        WHERE `gcontact`.`nurl` = ? AND `platform` != ''", normalise_link($profile));
 
index 633b8e12e93dec5ccdc10a1cf18b7fb69f2b0d21..2d4a8cb94b11af9fd3dcf201ab71420f43a1d190 100644 (file)
@@ -477,7 +477,7 @@ class Worker
 
                if ($max == 0) {
                        // the maximum number of possible user connections can be a system variable
-                       $r = DBA::fetch_first("SHOW VARIABLES WHERE `variable_name` = 'max_user_connections'");
+                       $r = DBA::fetchFirst("SHOW VARIABLES WHERE `variable_name` = 'max_user_connections'");
                        if (DBM::is_result($r)) {
                                $max = $r["Value"];
                        }
@@ -513,7 +513,7 @@ class Worker
 
                // We will now check for the system values.
                // This limit could be reached although the user limits are fine.
-               $r = DBA::fetch_first("SHOW VARIABLES WHERE `variable_name` = 'max_connections'");
+               $r = DBA::fetchFirst("SHOW VARIABLES WHERE `variable_name` = 'max_connections'");
                if (!DBM::is_result($r)) {
                        return false;
                }
@@ -521,7 +521,7 @@ class Worker
                if ($max == 0) {
                        return false;
                }
-               $r = DBA::fetch_first("SHOW STATUS WHERE `variable_name` = 'Threads_connected'");
+               $r = DBA::fetchFirst("SHOW STATUS WHERE `variable_name` = 'Threads_connected'");
                if (!DBM::is_result($r)) {
                        return false;
                }
index f7fc8a6ae6c8b0ae133c1f2b5c999a82bb648789..64ee3a00dc317d80ecd3669fd87634bb50ad5ca1 100644 (file)
@@ -683,7 +683,7 @@ class DBA
         * @param string $sql SQL statement
         * @return array first row of query
         */
-       public static function fetch_first($sql) {
+       public static function fetchFirst($sql) {
                $params = self::getParam(func_get_args());
 
                $stmt = self::p($sql, $params);
@@ -1344,7 +1344,7 @@ class DBA
 
                $sql = "SELECT COUNT(*) AS `count` FROM `".$table."`".$condition_string;
 
-               $row = self::fetch_first($sql, $condition);
+               $row = self::fetchFirst($sql, $condition);
 
                return $row['count'];
        }
index f8957c8a63c8debc02c01082772d453d68114fe7..14382d4188e9e260aab74c249f64b538f06ec5b2 100644 (file)
@@ -72,7 +72,7 @@ class Contact extends BaseObject
        {
                $return = 0;
                if (intval($gid)) {
-                       $contacts = DBA::fetch_first('SELECT COUNT(*) AS `count`
+                       $contacts = DBA::fetchFirst('SELECT COUNT(*) AS `count`
                                FROM `contact`
                                INNER JOIN `group_member`
                                        ON `contact`.`id` = `group_member`.`contact-id`
index 85c4ce3c01070821da9f8a48ac35b88baaa171f2..b9ba0d4c37076b03faa19fc502557944ea5cd5a4 100644 (file)
@@ -2427,7 +2427,7 @@ class Item extends BaseObject
 
                // Does the given user have this item?
                if ($uid) {
-                       $item = DBA::fetch_first("SELECT `item`.`id`, `user`.`nickname` FROM `item`
+                       $item = DBA::fetchFirst("SELECT `item`.`id`, `user`.`nickname` FROM `item`
                                INNER JOIN `user` ON `user`.`uid` = `item`.`uid`
                                WHERE `item`.`visible` AND NOT `item`.`deleted` AND NOT `item`.`moderated`
                                        AND `item`.`guid` = ? AND `item`.`uid` = ?", $guid, $uid);
@@ -2439,7 +2439,7 @@ class Item extends BaseObject
 
                // Or is it anywhere on the server?
                if ($nick == "") {
-                       $item = DBA::fetch_first("SELECT `item`.`id`, `user`.`nickname` FROM `item`
+                       $item = DBA::fetchFirst("SELECT `item`.`id`, `user`.`nickname` FROM `item`
                                INNER JOIN `user` ON `user`.`uid` = `item`.`uid`
                                WHERE `item`.`visible` AND NOT `item`.`deleted` AND NOT `item`.`moderated`
                                        AND NOT `item`.`private` AND `item`.`wall`
index d975dbb3f46234e9849bb18090c659f01320878a..82507b9c0344c2e69ec1a38222748fbdea1d44f0 100644 (file)
@@ -210,7 +210,7 @@ class Profile
                $profile = null;
 
                if ($profile_id) {
-                       $profile = DBA::fetch_first(
+                       $profile = DBA::fetchFirst(
                                "SELECT `contact`.`id` AS `contact_id`, `contact`.`photo` AS `contact_photo`,
                                        `contact`.`thumb` AS `contact_thumb`, `contact`.`micro` AS `contact_micro`,
                                        `profile`.`uid` AS `profile_uid`, `profile`.*,
@@ -224,7 +224,7 @@ class Profile
                        );
                }
                if (!DBM::is_result($profile)) {
-                       $profile = DBA::fetch_first(
+                       $profile = DBA::fetchFirst(
                                "SELECT `contact`.`id` AS `contact_id`, `contact`.`photo` as `contact_photo`,
                                        `contact`.`thumb` AS `contact_thumb`, `contact`.`micro` AS `contact_micro`,
                                        `profile`.`uid` AS `profile_uid`, `profile`.*,
index 125b722bcf57c0a39c20553bba36b4949df04558..8d4e52cacc79640d0375a58133143f4b64f93b78 100644 (file)
@@ -38,7 +38,7 @@ class User
         * @return boolean|array
         */
        public static function getOwnerDataById($uid) {
-               $r = DBA::fetch_first("SELECT
+               $r = DBA::fetchFirst("SELECT
                        `contact`.*,
                        `user`.`prvkey` AS `uprvkey`,
                        `user`.`timezone`,
index 28658e5cdbb382002d3df6b4de6804882ede2321..0727658683117c57217e6f3a3c035a5a536556f5 100644 (file)
@@ -254,7 +254,7 @@ class Delivery extends BaseObject
                        }
 
                        // We now have some contact, so we fetch it
-                       $target_importer = DBA::fetch_first("SELECT *, `name` as `senderName`
+                       $target_importer = DBA::fetchFirst("SELECT *, `name` as `senderName`
                                                        FROM `contact`
                                                        WHERE NOT `blocked` AND `id` = ? LIMIT 1",
                                                        $cid);