]> git.mxchange.org Git - friendica.git/commitdiff
Rename Term methods ahead of the move
authorHypolite Petovan <mrpetovan@gmail.com>
Sun, 4 Feb 2018 03:42:31 +0000 (22:42 -0500)
committerHypolite Petovan <mrpetovan@gmail.com>
Sun, 4 Feb 2018 03:42:31 +0000 (22:42 -0500)
- Rename createFromItemURI() to insertFromItemFileByUri()
- Rename createFromItem() to insertFromItemFileById()

include/text.php
src/Model/Item.php
src/Model/Term.php
src/Protocol/DFRN.php

index dc604124fd4bb8fbab371d7035447809ab026a03..997371db2f90d7afef204f4c6e9c537b7241e125 100644 (file)
@@ -1901,7 +1901,7 @@ function file_tag_save_file($uid, $item, $file)
                        );
                }
 
-               Term::createFromItem($item);
+               Term::insertFromItemFileById($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::createFromItem($item);
+       Term::insertFromItemFileById($item);
 
        $r = q("SELECT `oid` FROM `term` WHERE `term` = '%s' AND `otype` = %d AND `type` = %d AND `uid` = %d",
                dbesc($file),
index d83546e340a2f3da2116ca05188cd6a0898caf0b..2399e88bf8f30f3e150c1bb5bc014c0075034c9a 100644 (file)
@@ -71,7 +71,7 @@ class Item extends BaseObject
                        }
 
                        create_tags_from_item($item['id']);
-                       Term::createFromItem($item['id']);
+                       Term::insertFromItemFileById($item['id']);
                        update_thread($item['id']);
 
                        Worker::add(PRIORITY_HIGH, "Notifier", 'edit_post', $item['id']);
@@ -153,7 +153,7 @@ class Item extends BaseObject
                                ['id' => $item['id']]);
 
                create_tags_from_item($item['id']);
-               Term::createFromItem($item['id']);
+               Term::insertFromItemFileById($item['id']);
                delete_thread($item['id'], $item['parent-uri']);
 
                // If it's the parent of a comment thread, kill all the kids
@@ -792,7 +792,7 @@ class Item extends BaseObject
                 * This is not perfect - but a workable solution until we found the reason for the problem.
                 */
                create_tags_from_item($current_post);
-               Term::createFromItem($current_post);
+               Term::insertFromItemFileById($current_post);
 
                if ($arr['parent-uri'] === $arr['uri']) {
                        self::addShadow($current_post);
index 5f536cae424199feac52039414f6d75f5378cc02..2b9442105ac6828bc3fa0af1a52f357dbb4ed7f5 100644 (file)
@@ -4,6 +4,7 @@
  */
 namespace Friendica\Model;
 
+use Friendica\Database\DBM;
 use dba;
 
 require_once "include/dba.php";
@@ -14,10 +15,10 @@ class Term
         * @param integer $itemid item id
         * @return void
         */
-       public static function createFromItem($itemid)
+       public static function insertFromItemFileById($itemid)
        {
                $message = dba::selectFirst('item', ['uid', 'deleted', 'file'], ['id' => $itemid]);
-               if (!\Friendica\Database\DBM::is_result($message)) {
+               if (!DBM::is_result($message)) {
                        return;
                }
 
@@ -62,13 +63,13 @@ class Term
         * @param integer $uid     uid
         * @return void
         */
-       public static function createFromItemURI($itemuri, $uid)
+       public static function insertFromItemFileByUri($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::createFromItem($message["id"]);
+                               self::insertFromItemFileById($message["id"]);
                        }
                }
        }
index 2269bffcfdc49db18de53961044f2f88a9dbe701..80194a53a29ec35cd6481e8e63d59e792306bdcd 100644 (file)
@@ -2841,7 +2841,7 @@ class DFRN
                                        intval($importer["uid"])
                                );
                                create_tags_from_itemuri($uri, $importer["uid"]);
-                               Term::createFromItemURI($uri, $importer["uid"]);
+                               Term::insertFromItemFileByUri($uri, $importer["uid"]);
                                update_thread_uri($uri, $importer["uid"]);
                        } else {
                                $r = q(
@@ -2854,7 +2854,7 @@ class DFRN
                                        intval($importer["uid"])
                                );
                                create_tags_from_itemuri($uri, $importer["uid"]);
-                               Term::createFromItemURI($uri, $importer["uid"]);
+                               Term::insertFromItemFileByUri($uri, $importer["uid"]);
                                update_thread_uri($uri, $importer["importer_uid"]);
 
                                // if this is a relayed delete, propagate it to other recipients