Nextcloud PHP API (master)

IReferenceManager

Tags
since
25.0.0

Table of Contents

Methods

extractReferences()  : array<string|int, string>
Return all reference identifiers within a string as an array
getDiscoverableProviders()  : array<string|int, IDiscoverableReferenceProvider>
Get information on discoverable reference providers (id, title, icon and order) If the provider is searchable, also get the list of supported unified search providers
getReferenceByCacheKey()  : IReference|null
Get a reference by its cache key
getReferenceFromCache()  : IReference|null
Explicitly get a reference from the cache to avoid heavy fetches for cases the cache can then be filled with a separate request from the frontend
getUserProviderTimestamps()  : array<string|int, int>
Get all known last used timestamps for reference providers
invalidateCache()  : void
Invalidate all cache entries with a prefix or just one if the cache key is provided
resolveReference()  : IReference|null
Resolve a given reference id to its metadata with all available providers
touchProvider()  : bool
Update or set the last used timestamp for a provider

Methods

extractReferences()

Return all reference identifiers within a string as an array

public extractReferences(string $text) : array<string|int, string>
Parameters
$text : string
Tags
since
25.0.0
Return values
array<string|int, string>

Array of found references (urls)

getReferenceByCacheKey()

Get a reference by its cache key

public getReferenceByCacheKey(string $cacheKey) : IReference|null
Parameters
$cacheKey : string
Tags
since
25.0.0
Return values
IReference|null

getReferenceFromCache()

Explicitly get a reference from the cache to avoid heavy fetches for cases the cache can then be filled with a separate request from the frontend

public getReferenceFromCache(string $referenceId[, bool $public = false ][, string $sharingToken = '' ]) : IReference|null
Parameters
$referenceId : string
$public : bool = false
$sharingToken : string = ''
Tags
since
25.0.0
since
30.0.0

optional arguments $public and $sharingToken

Return values
IReference|null

getUserProviderTimestamps()

Get all known last used timestamps for reference providers

public getUserProviderTimestamps() : array<string|int, int>
Tags
since
26.0.0
Return values
array<string|int, int>

invalidateCache()

Invalidate all cache entries with a prefix or just one if the cache key is provided

public invalidateCache(string $cachePrefix[, string|null $cacheKey = null ]) : void
Parameters
$cachePrefix : string
$cacheKey : string|null = null
Tags
since
25.0.0

resolveReference()

Resolve a given reference id to its metadata with all available providers

public resolveReference(string $referenceId[, bool $public = false ][, string $sharingToken = '' ]) : IReference|null

This method has a fallback to always provide the open graph metadata, but may still return null in case this is disabled or the fetching fails

Parameters
$referenceId : string
$public : bool = false
$sharingToken : string = ''
Tags
since
25.0.0
since
30.0.0

optional arguments $public and $sharingToken

Return values
IReference|null

touchProvider()

Update or set the last used timestamp for a provider

public touchProvider(string $userId, string $providerId[, int|null $timestamp = null ]) : bool
Parameters
$userId : string
$providerId : string
$timestamp : int|null = null

use current timestamp if null

Tags
since
26.0.0
Return values
bool

        
On this page

Search results