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