SearchResultEntry
in package
implements
JsonSerializable
Represents an entry in a list of results an app returns for a unified search query.
The app providing the results has to extend this class for customization. In most cases apps do not have to add any additional code.
Tags
Table of Contents
Interfaces
- JsonSerializable
Properties
- $attributes : array<string|int, string>
- $icon : string
- $resourceUrl : string
- $rounded : bool
- $subline : string
- $thumbnailUrl : string
- $title : string
Methods
- __construct() : mixed
- addAttribute() : void
- Add optional attributes to the result entry, e.g. an ID or some other context information that can be read by the client application
- jsonSerialize() : array<string|int, mixed>
Properties
$attributes
protected
array<string|int, string>
$attributes
= []
Tags
$icon
protected
string
$icon
Tags
$resourceUrl
protected
string
$resourceUrl
Tags
$rounded
protected
bool
$rounded
Tags
$subline
protected
string
$subline
Tags
$thumbnailUrl
protected
string
$thumbnailUrl
Tags
$title
protected
string
$title
Tags
Methods
__construct()
public
__construct(string $thumbnailUrl, string $title, string $subline, string $resourceUrl[, string $icon = '' ][, bool $rounded = false ]) : mixed
Parameters
- $thumbnailUrl : string
-
a relative or absolute URL to the thumbnail or icon of the entry
- $title : string
-
a main title of the entry
- $subline : string
-
the secondary line of the entry
- $resourceUrl : string
-
the URL where the user can find the detail, like a deep link inside the app
- $icon : string = ''
-
the icon class or url to the icon
- $rounded : bool = false
-
is the thumbnail rounded
Tags
addAttribute()
Add optional attributes to the result entry, e.g. an ID or some other context information that can be read by the client application
public
addAttribute(string $key, string $value) : void
Parameters
- $key : string
- $value : string
Tags
jsonSerialize()
public
jsonSerialize() : array<string|int, mixed>