mirror of
https://github.com/friendica/friendica
synced 2025-04-27 10:30:10 +00:00
Moving Search to Core, Refactor Objects
This commit is contained in:
parent
419cc81ef1
commit
1e36c68e48
6 changed files with 306 additions and 279 deletions
|
@ -9,7 +9,7 @@ use Friendica\Model\Search;
|
|||
*
|
||||
* @see Search for details
|
||||
*/
|
||||
class ContactResult
|
||||
class ContactResult implements IResult
|
||||
{
|
||||
/**
|
||||
* @var int
|
||||
|
@ -123,14 +123,15 @@ class ContactResult
|
|||
/**
|
||||
* @param string $name
|
||||
* @param string $addr
|
||||
* @param string $item
|
||||
* @param string $url
|
||||
* @param string $photo
|
||||
* @param string $network
|
||||
* @param int $cid
|
||||
* @param int $pcid
|
||||
* @param int $pCid
|
||||
* @param string $tags
|
||||
*/
|
||||
public function __construct($name, $addr, $item, $url, $photo, $network, $cid = 0, $pcid = 0, $tags = '')
|
||||
public function __construct($name, $addr, $item, $url, $photo, $network, $cid = 0, $pCid = 0, $tags = '')
|
||||
{
|
||||
$this->name = $name;
|
||||
$this->addr = $addr;
|
||||
|
@ -140,7 +141,7 @@ class ContactResult
|
|||
$this->network = $network;
|
||||
|
||||
$this->cid = $cid;
|
||||
$this->pCid = $pcid;
|
||||
$this->pCid = $pCid;
|
||||
$this->tags = $tags;
|
||||
}
|
||||
}
|
||||
|
|
10
src/Object/Search/IResult.php
Normal file
10
src/Object/Search/IResult.php
Normal file
|
@ -0,0 +1,10 @@
|
|||
<?php
|
||||
|
||||
|
||||
namespace Friendica\Object\Search;
|
||||
|
||||
|
||||
interface IResult
|
||||
{
|
||||
|
||||
}
|
|
@ -5,11 +5,11 @@ namespace Friendica\Object\Search;
|
|||
use Friendica\Model\Search;
|
||||
|
||||
/**
|
||||
* A list of search results for contacts with metadata
|
||||
* A list of search results with metadata
|
||||
*
|
||||
* @see Search for details
|
||||
*/
|
||||
class ContactResultList
|
||||
class ResultList
|
||||
{
|
||||
/**
|
||||
* Page of the result list
|
||||
|
@ -29,7 +29,7 @@ class ContactResultList
|
|||
/**
|
||||
* Array of results
|
||||
*
|
||||
* @var ContactResult[]
|
||||
* @var IResult[]
|
||||
*/
|
||||
private $results;
|
||||
|
||||
|
@ -58,7 +58,7 @@ class ContactResultList
|
|||
}
|
||||
|
||||
/**
|
||||
* @return ContactResult[]
|
||||
* @return IResult[]
|
||||
*/
|
||||
public function getResults()
|
||||
{
|
||||
|
@ -69,7 +69,7 @@ class ContactResultList
|
|||
* @param int $page
|
||||
* @param int $total
|
||||
* @param int $itemsPage
|
||||
* @param ContactResult[] $results
|
||||
* @param IResult[] $results
|
||||
*/
|
||||
public function __construct($page = 0, $total = 0, $itemsPage = 0, array $results = [])
|
||||
{
|
||||
|
@ -83,9 +83,9 @@ class ContactResultList
|
|||
/**
|
||||
* Adds a result to the result list
|
||||
*
|
||||
* @param ContactResult $result
|
||||
* @param IResult $result
|
||||
*/
|
||||
public function addResult(ContactResult $result)
|
||||
public function addResult(IResult $result)
|
||||
{
|
||||
$this->results[] = $result;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue