]> git.mxchange.org Git - friendica.git/commitdiff
Rename Model\Term methods
authorHypolite Petovan <mrpetovan@gmail.com>
Sun, 4 Feb 2018 21:48:50 +0000 (16:48 -0500)
committerHypolite Petovan <mrpetovan@gmail.com>
Sun, 4 Feb 2018 21:48:50 +0000 (16:48 -0500)
include/text.php
mod/photos.php
mod/videos.php
src/Model/Item.php
src/Model/Term.php
src/Protocol/DFRN.php

index 997371db2f90d7afef204f4c6e9c537b7241e125..6c6927a78bc7047d4e100b2c89f51bad5431941f 100644 (file)
@@ -1901,7 +1901,7 @@ function file_tag_save_file($uid, $item, $file)
                        );
                }
 
-               Term::insertFromItemFileById($item);
+               Term::insertFromFileFieldByItemId($item);
 
                $saved = PConfig::get($uid, 'system', 'filetags');
                if (!strlen($saved) || !stristr($saved, '[' . file_tag_encode($file) . ']')) {
@@ -1940,7 +1940,7 @@ function file_tag_unsave_file($uid, $item, $file, $cat = false)
                intval($uid)
        );
 
-       Term::insertFromItemFileById($item);
+       Term::insertFromFileFieldByItemId($item);
 
        $r = q("SELECT `oid` FROM `term` WHERE `term` = '%s' AND `otype` = %d AND `type` = %d AND `uid` = %d",
                dbesc($file),
index 6c717875ad6ca5eefe02f91efe83b56d9de75b9e..e86c7271a098b19e574c27a9a77249b89f75907c 100644 (file)
@@ -295,7 +295,7 @@ function photos_post(App $a)
                                                dbesc($rr['parent-uri']),
                                                intval($page_owner_uid)
                                        );
-                                       Term::insertFromItemUri($rr['parent-uri'], $page_owner_uid);
+                                       Term::insertFromTagFieldByItemUri($rr['parent-uri'], $page_owner_uid);
                                        delete_thread_uri($rr['parent-uri'], $page_owner_uid);
 
                                        $drop_id = intval($rr['id']);
@@ -369,7 +369,7 @@ function photos_post(App $a)
                                        dbesc($i[0]['uri']),
                                        intval($page_owner_uid)
                                );
-                               Term::insertFromItemUri($i[0]['uri'], $page_owner_uid);
+                               Term::insertFromTagFieldByItemUri($i[0]['uri'], $page_owner_uid);
                                delete_thread_uri($i[0]['uri'], $page_owner_uid);
 
                                $url = System::baseUrl();
@@ -654,7 +654,7 @@ function photos_post(App $a)
                                intval($item_id),
                                intval($page_owner_uid)
                        );
-                       Term::insertFromItemId($item_id);
+                       Term::insertFromTagFieldByItemId($item_id);
                        update_thread($item_id);
 
                        $best = 0;
index 783fbc7506a70998e370520afcc2ddec73d38022..7db81f6d205ffb9db399615a0db4976780c8c7f8 100644 (file)
@@ -176,7 +176,7 @@ function videos_post(App $a) {
                                        dbesc($i[0]['uri']),
                                        intval(local_user())
                                );
-                               Term::insertFromItemUri($i[0]['uri'], local_user());
+                               Term::insertFromTagFieldByItemUri($i[0]['uri'], local_user());
                                delete_thread_uri($i[0]['uri'], local_user());
 
                                $url = System::baseUrl();
index 2d1bad2462977bdd72d6783fb602a2fe6a645d01..e7db218eda10d06342aef65353c3ec59a53670fd 100644 (file)
@@ -69,8 +69,8 @@ class Item extends BaseObject
                                continue;
                        }
 
-                       Term::insertFromItemId($item['id']);
-                       Term::insertFromItemFileById($item['id']);
+                       Term::insertFromTagFieldByItemId($item['id']);
+                       Term::insertFromFileFieldByItemId($item['id']);
                        update_thread($item['id']);
 
                        Worker::add(PRIORITY_HIGH, "Notifier", 'edit_post', $item['id']);
@@ -151,8 +151,8 @@ class Item extends BaseObject
                                        'edited' => DateTimeFormat::utcNow(), 'changed' => DateTimeFormat::utcNow()],
                                ['id' => $item['id']]);
 
-               Term::insertFromItemId($item['id']);
-               Term::insertFromItemFileById($item['id']);
+               Term::insertFromTagFieldByItemId($item['id']);
+               Term::insertFromFileFieldByItemId($item['id']);
                delete_thread($item['id'], $item['parent-uri']);
 
                // If it's the parent of a comment thread, kill all the kids
@@ -790,8 +790,8 @@ class Item extends BaseObject
                 * Due to deadlock issues with the "term" table we are doing these steps after the commit.
                 * This is not perfect - but a workable solution until we found the reason for the problem.
                 */
-               Term::insertFromItemId($current_post);
-               Term::insertFromItemFileById($current_post);
+               Term::insertFromTagFieldByItemId($current_post);
+               Term::insertFromFileFieldByItemId($current_post);
 
                if ($arr['parent-uri'] === $arr['uri']) {
                        self::addShadow($current_post);
index 4ff59596daace124c363c596559601f1781d331d..c730bf74499b8914c962c414aa11fcb5d3675aee 100644 (file)
@@ -13,7 +13,7 @@ require_once 'include/dba.php';
 
 class Term
 {
-       public static function insertFromItemId($itemid)
+       public static function insertFromTagFieldByItemId($itemid)
        {
                $profile_base = System::baseUrl();
                $profile_data = parse_url($profile_base);
@@ -122,13 +122,13 @@ class Term
                }
        }
 
-       public static function insertFromItemUri($itemuri, $uid)
+       public static function insertFromTagFieldByItemUri($itemuri, $uid)
        {
                $messages = dba::select('item', ['id'], ['uri' => $itemuri, 'uid' => $uid]);
 
                if (DBM::is_result($messages)) {
                        while ($message = dba::fetch($messages)) {
-                               self::insertFromItemId($message['id']);
+                               self::insertFromTagFieldByItemId($message['id']);
                        }
                        dba::close($messages);
                }
@@ -139,7 +139,7 @@ class Term
         * @param integer $itemid item id
         * @return void
         */
-       public static function insertFromItemFileById($itemid)
+       public static function insertFromFileFieldByItemId($itemid)
        {
                $message = dba::selectFirst('item', ['uid', 'deleted', 'file'], ['id' => $itemid]);
                if (!DBM::is_result($message)) {
@@ -187,13 +187,13 @@ class Term
         * @param integer $uid     uid
         * @return void
         */
-       public static function insertFromItemFileByUri($itemuri, $uid)
+       public static function insertFromFileFieldByItemUri($itemuri, $uid)
        {
                $messages = q("SELECT `id` FROM `item` WHERE uri ='%s' AND uid=%d", dbesc($itemuri), intval($uid));
 
                if (count($messages)) {
                        foreach ($messages as $message) {
-                               self::insertFromItemFileById($message["id"]);
+                               self::insertFromFileFieldByItemId($message["id"]);
                        }
                }
        }
index 607a81b72d4f3c69b390d7dce4c2ca653bd95615..a9c5f04d3e120e6c4f66e56e2a5d80199fa41db4 100644 (file)
@@ -2091,7 +2091,7 @@ class DFRN
                        $condition = ["`uri` = ? AND `uid` IN (0, ?)", $item["uri"], $importer["importer_uid"]];
                        dba::update('item', $fields, $condition);
 
-                       Term::insertFromItemUri($item["uri"], $importer["importer_uid"]);
+                       Term::insertFromTagFieldByItemUri($item["uri"], $importer["importer_uid"]);
                        update_thread_uri($item["uri"], $importer["importer_uid"]);
 
                        $changed = true;
@@ -2335,7 +2335,7 @@ class DFRN
                                                                dbesc($r[0]["tag"] . (strlen($r[0]["tag"]) ? ',' : '') . '#[url=' . $xo->id . ']'. $xo->content . '[/url]'),
                                                                intval($r[0]["id"])
                                                        );
-                                                       Term::insertFromItemId($r[0]["id"]);
+                                                       Term::insertFromTagFieldByItemId($r[0]["id"]);
                                                }
                                        }
                                }
@@ -2823,7 +2823,7 @@ class DFRN
                                                                dbesc(implode(',', $newtags)),
                                                                intval($i[0]["id"])
                                                        );
-                                                       Term::insertFromItemId($i[0]["id"]);
+                                                       Term::insertFromTagFieldByItemId($i[0]["id"]);
                                                }
                                        }
                                }
@@ -2839,8 +2839,8 @@ class DFRN
                                        dbesc($uri),
                                        intval($importer["uid"])
                                );
-                               Term::insertFromItemUri($uri, $importer["uid"]);
-                               Term::insertFromItemFileByUri($uri, $importer["uid"]);
+                               Term::insertFromTagFieldByItemUri($uri, $importer["uid"]);
+                               Term::insertFromFileFieldByItemUri($uri, $importer["uid"]);
                                update_thread_uri($uri, $importer["uid"]);
                        } else {
                                $r = q(
@@ -2852,8 +2852,8 @@ class DFRN
                                        dbesc($uri),
                                        intval($importer["uid"])
                                );
-                               Term::insertFromItemUri($uri, $importer["uid"]);
-                               Term::insertFromItemFileByUri($uri, $importer["uid"]);
+                               Term::insertFromTagFieldByItemUri($uri, $importer["uid"]);
+                               Term::insertFromFileFieldByItemUri($uri, $importer["uid"]);
                                update_thread_uri($uri, $importer["importer_uid"]);
 
                                // if this is a relayed delete, propagate it to other recipients