IReferenceManager
in
Tags
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
Return values
array<string|int, string> —Array of found references (urls)
getDiscoverableProviders()
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
public
getDiscoverableProviders() : array<string|int, IDiscoverableReferenceProvider>
Tags
Return values
array<string|int, IDiscoverableReferenceProvider>getReferenceByCacheKey()
Get a reference by its cache key
public
getReferenceByCacheKey(string $cacheKey) : IReference|null
Parameters
- $cacheKey : string
Tags
Return values
IReference|nullgetReferenceFromCache()
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
Return values
IReference|nullgetUserProviderTimestamps()
Get all known last used timestamps for reference providers
public
getUserProviderTimestamps() : array<string|int, int>
Tags
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
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
Return values
IReference|nulltouchProvider()
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