mirror of
https://github.com/friendica/friendica
synced 2025-04-27 13:10:10 +00:00
Merge branch 'master' into develop
This commit is contained in:
commit
b9ab613777
164 changed files with 30233 additions and 26266 deletions
|
@ -781,7 +781,7 @@ class Image
|
|||
$data = Cache::get($url);
|
||||
|
||||
if (is_null($data) || !$data || !is_array($data)) {
|
||||
$img_str = Network::fetchUrl($url, true, $redirects, 4);
|
||||
$img_str = Network::fetchUrl($url, true, 4);
|
||||
|
||||
if (!$img_str) {
|
||||
return false;
|
||||
|
|
147
src/Object/Search/ContactResult.php
Normal file
147
src/Object/Search/ContactResult.php
Normal file
|
@ -0,0 +1,147 @@
|
|||
<?php
|
||||
|
||||
namespace Friendica\Object\Search;
|
||||
|
||||
use Friendica\Model\Search;
|
||||
|
||||
/**
|
||||
* A search result for contact searching
|
||||
*
|
||||
* @see Search for details
|
||||
*/
|
||||
class ContactResult implements IResult
|
||||
{
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
private $cid;
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
private $pCid;
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
private $name;
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
private $addr;
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
private $item;
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
private $url;
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
private $photo;
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
private $tags;
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
private $network;
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getCid()
|
||||
{
|
||||
return $this->cid;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getPCid()
|
||||
{
|
||||
return $this->pCid;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getName()
|
||||
{
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getAddr()
|
||||
{
|
||||
return $this->addr;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getItem()
|
||||
{
|
||||
return $this->item;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getUrl()
|
||||
{
|
||||
return $this->url;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getPhoto()
|
||||
{
|
||||
return $this->photo;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getTags()
|
||||
{
|
||||
return $this->tags;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getNetwork()
|
||||
{
|
||||
return $this->network;
|
||||
}
|
||||
|
||||
/**
|
||||
* @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 string $tags
|
||||
*/
|
||||
public function __construct($name, $addr, $item, $url, $photo, $network, $cid = 0, $pCid = 0, $tags = '')
|
||||
{
|
||||
$this->name = $name;
|
||||
$this->addr = $addr;
|
||||
$this->item = $item;
|
||||
$this->url = $url;
|
||||
$this->photo = $photo;
|
||||
$this->network = $network;
|
||||
|
||||
$this->cid = $cid;
|
||||
$this->pCid = $pCid;
|
||||
$this->tags = $tags;
|
||||
}
|
||||
}
|
11
src/Object/Search/IResult.php
Normal file
11
src/Object/Search/IResult.php
Normal file
|
@ -0,0 +1,11 @@
|
|||
<?php
|
||||
|
||||
namespace Friendica\Object\Search;
|
||||
|
||||
/**
|
||||
* The default interface for each search result
|
||||
*/
|
||||
interface IResult
|
||||
{
|
||||
|
||||
}
|
92
src/Object/Search/ResultList.php
Normal file
92
src/Object/Search/ResultList.php
Normal file
|
@ -0,0 +1,92 @@
|
|||
<?php
|
||||
|
||||
namespace Friendica\Object\Search;
|
||||
|
||||
use Friendica\Model\Search;
|
||||
|
||||
/**
|
||||
* A list of search results with metadata
|
||||
*
|
||||
* @see Search for details
|
||||
*/
|
||||
class ResultList
|
||||
{
|
||||
/**
|
||||
* Page of the result list
|
||||
* @var int
|
||||
*/
|
||||
private $page;
|
||||
/**
|
||||
* Total count of results
|
||||
* @var int
|
||||
*/
|
||||
private $total;
|
||||
/**
|
||||
* items per page
|
||||
* @var int
|
||||
*/
|
||||
private $itemsPage;
|
||||
/**
|
||||
* Array of results
|
||||
*
|
||||
* @var IResult[]
|
||||
*/
|
||||
private $results;
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getPage()
|
||||
{
|
||||
return $this->page;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getTotal()
|
||||
{
|
||||
return $this->total;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getItemsPage()
|
||||
{
|
||||
return $this->itemsPage;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return IResult[]
|
||||
*/
|
||||
public function getResults()
|
||||
{
|
||||
return $this->results;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $page
|
||||
* @param int $total
|
||||
* @param int $itemsPage
|
||||
* @param IResult[] $results
|
||||
*/
|
||||
public function __construct($page = 0, $total = 0, $itemsPage = 0, array $results = [])
|
||||
{
|
||||
$this->page = $page;
|
||||
$this->total = $total;
|
||||
$this->itemsPage = $itemsPage;
|
||||
|
||||
$this->results = $results;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a result to the result list
|
||||
*
|
||||
* @param IResult $result
|
||||
*/
|
||||
public function addResult(IResult $result)
|
||||
{
|
||||
$this->results[] = $result;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue