]> git.mxchange.org Git - friendica.git/blobdiff - src/Model/Post/Category.php
Merge pull request #12674 from nupplaphil/bug/config_typesafe
[friendica.git] / src / Model / Post / Category.php
index c2912fa73fa7a890351003deff36d18b463ab29e..2c35a40ad4b8756adc990ecfe01bce85982ed371 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2010-2021, the Friendica project
+ * @copyright Copyright (C) 2010-2023, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
@@ -111,6 +111,11 @@ class Category
                return array_column($tags, 'name');
        }
 
+       public static function existsForURIId(int $uri_id, int $uid)
+       {
+               return DBA::exists('post-category', ['uri-id' => $uri_id, 'uid' => $uid]);
+       }
+
        /**
         * Generates an array of files or categories of a given uri-id
         *
@@ -183,7 +188,7 @@ class Category
 
                if (preg_match_all("/\<(.*?)\>/ism", $files, $result)) {
                        foreach ($result[1] as $file) {
-                               self::storeFileByURIId($uri_id, $uid, self::FILE, $file);
+                               self::storeFileByURIId($uri_id, $uid, self::CATEGORY, $file);
                        }
                }
        }