Nextcloud PHP API (master)

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
example

``class MailResultEntry extends SearchResultEntry }`

This approach was chosen over a final class as it allows Nextcloud to later add new optional properties of an entry without having to break the usage of this class in apps.

since
20.0.0

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
psalm-var

array<string, string>

since
20.0.0

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
since
20.0.0

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
since
20.0.0

jsonSerialize()

public jsonSerialize() : array<string|int, mixed>
Tags
since
20.0.0
Return values
array<string|int, mixed>

        
On this page

Search results