]> git.mxchange.org Git - friendica.git/blob - src/Model/Search.php
Merge pull request #7760 from annando/fix-fatal
[friendica.git] / src / Model / Search.php
1 <?php
2
3 namespace Friendica\Model;
4
5 use Friendica\BaseObject;
6 use Friendica\Database\DBA;
7
8 /**
9  * Model for DB specific logic for the search entity
10  */
11 class Search extends BaseObject
12 {
13         /**
14          * Returns the list of user defined tags (e.g. #Friendica)
15          *
16          * @return array
17          *
18          * @throws \Exception
19          */
20         public static function getUserTags()
21         {
22                 $termsStmt = DBA::p("SELECT DISTINCT(`term`) FROM `search`");
23
24                 $tags = [];
25
26                 while ($term = DBA::fetch($termsStmt)) {
27                         $tags[] = trim($term['term'], '#');
28                 }
29
30                 return $tags;
31         }
32 }