mirror of
https://github.com/friendica/friendica
synced 2025-04-28 18:24:24 +02:00
Move .well-known, webfinger, xrd to src/Module/
This commit is contained in:
parent
e7f8d8c3b6
commit
90248f6bb7
10 changed files with 358 additions and 275 deletions
32
src/Model/Search.php
Normal file
32
src/Model/Search.php
Normal file
|
@ -0,0 +1,32 @@
|
|||
<?php
|
||||
|
||||
namespace Friendica\Model;
|
||||
|
||||
use Friendica\BaseObject;
|
||||
use Friendica\Database\DBA;
|
||||
|
||||
/**
|
||||
* Model for DB specific logic for the search entity
|
||||
*/
|
||||
class Search extends BaseObject
|
||||
{
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
}
|
|
@ -91,12 +91,24 @@ class User
|
|||
|
||||
/**
|
||||
* @param integer $uid
|
||||
* @param array $fields
|
||||
* @return array|boolean User record if it exists, false otherwise
|
||||
* @throws Exception
|
||||
*/
|
||||
public static function getById($uid)
|
||||
public static function getById($uid, array $fields = [])
|
||||
{
|
||||
return DBA::selectFirst('user', [], ['uid' => $uid]);
|
||||
return DBA::selectFirst('user', $fields, ['uid' => $uid]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $nickname
|
||||
* @param array $fields
|
||||
* @return array|boolean User record if it exists, false otherwise
|
||||
* @throws Exception
|
||||
*/
|
||||
public static function getByNickname($nickname, array $fields = [])
|
||||
{
|
||||
return DBA::selectFirst('user', $fields, ['nickname' => $nickname]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue