2019-04-30 18:14:06 -04:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Friendica\Model;
|
|
|
|
|
|
|
|
use Friendica\Database\DBA;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Model for DB specific logic for the search entity
|
|
|
|
*/
|
2019-12-15 17:28:01 -05:00
|
|
|
class Search
|
2019-04-30 18:14:06 -04:00
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Returns the list of user defined tags (e.g. #Friendica)
|
|
|
|
*
|
|
|
|
* @return array
|
|
|
|
*
|
|
|
|
* @throws \Exception
|
|
|
|
*/
|
|
|
|
public static function getUserTags()
|
|
|
|
{
|
|
|
|
$termsStmt = DBA::p("SELECT DISTINCT(`term`) FROM `search`");
|
|
|
|
|
|
|
|
$tags = [];
|
|
|
|
|
|
|
|
while ($term = DBA::fetch($termsStmt)) {
|
|
|
|
$tags[] = trim($term['term'], '#');
|
|
|
|
}
|
|
|
|
|
|
|
|
return $tags;
|
|
|
|
}
|
|
|
|
}
|