X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FModel%2FTag.php;h=2bdbbc8aca1351400a4ffd3dbba330af29fdab34;hb=f9994548c1f1110c7f548e00fcf1b6ee42b9de3b;hp=f947b9f898429744b2f427e3dd1fa0fd4619499f;hpb=852ee2f5c5e2b3ea5dc45d4bb53b0922e4932c0b;p=friendica.git diff --git a/src/Model/Tag.php b/src/Model/Tag.php index f947b9f898..2bdbbc8aca 100644 --- a/src/Model/Tag.php +++ b/src/Model/Tag.php @@ -25,6 +25,7 @@ use Friendica\Content\Text\BBCode; use Friendica\Core\Cache\Duration; use Friendica\Core\Logger; use Friendica\Core\System; +use Friendica\Database\Database; use Friendica\Database\DBA; use Friendica\DI; use Friendica\Util\Strings; @@ -151,7 +152,7 @@ class Tag } } - DBA::insert('post-tag', $fields, true); + DBA::insert('post-tag', $fields, Database::INSERT_IGNORE); Logger::info('Stored tag/mention', ['uri-id' => $uriid, 'tag-id' => $tagid, 'contact-id' => $cid, 'name' => $name, 'type' => $type, 'callstack' => System::callstack(8)]); } @@ -172,7 +173,7 @@ class Tag return $tag['id']; } - DBA::insert('tag', $fields, true); + DBA::insert('tag', $fields, Database::INSERT_IGNORE); $tid = DBA::lastInsertId(); if (!empty($tid)) { return $tid; @@ -516,7 +517,7 @@ class Tag * @return array * @throws \Exception */ - public static function setGlobalTrendingHashtags(int $period, $limit = 10) + public static function setGlobalTrendingHashtags(int $period, int $limit = 10) { $tagsStmt = DBA::p("SELECT `name` AS `term`, COUNT(*) AS `score` FROM `tag-search-view` @@ -559,7 +560,7 @@ class Tag * @return array * @throws \Exception */ - public static function setLocalTrendingHashtags(int $period, $limit = 10) + public static function setLocalTrendingHashtags(int $period, int $limit = 10) { $tagsStmt = DBA::p("SELECT `name` AS `term`, COUNT(*) AS `score` FROM `tag-search-view`