LinkReferenceProvider
in package
implements
IReferenceProvider, IPublicReferenceProvider
Tags
Table of Contents
Interfaces
Constants
- ALLOWED_CONTENT_TYPES = ['image/png', 'image/jpg', 'image/jpeg', 'image/gif', 'image/svg+xml', 'image/webp']
- MAX_CONTENT_LENGTH = 5 * 1024 * 1024
- for image size and webpage header
Properties
- $appDataFactory : IAppDataFactory
- $clientService : IClientService
- $limiter : Limiter
- $logger : LoggerInterface
- $request : IRequest
- $systemConfig : SystemConfig
- $urlGenerator : IURLGenerator
- $userSession : IUserSession
Methods
- __construct() : mixed
- getCacheKey() : string|null
- Return a custom cache key to be used for caching the metadata This could be for example the current user id if the reference access permissions are different for each user
- getCacheKeyPublic() : string|null
- Return a custom cache key to be used for caching the metadata This could be for example the current sharingToken if the reference access permissions are different for each share
- getCachePrefix() : string
- Return true if the reference metadata can be globally cached
- matchReference() : bool
- Validate that a given reference identifier matches the current provider
- resolveReference() : IReference|null
- Return a reference with its metadata for a given reference identifier
- resolveReferencePublic() : IReference|null
- Return a reference with its metadata for a given reference identifier and sharingToken
- fetchReference() : void
- Populates the reference with OpenGraph data
Constants
ALLOWED_CONTENT_TYPES
public
mixed
ALLOWED_CONTENT_TYPES
= ['image/png', 'image/jpg', 'image/jpeg', 'image/gif', 'image/svg+xml', 'image/webp']
Tags
MAX_CONTENT_LENGTH
for image size and webpage header
public
mixed
MAX_CONTENT_LENGTH
= 5 * 1024 * 1024
Tags
Properties
$appDataFactory
private
IAppDataFactory
$appDataFactory
$clientService
private
IClientService
$clientService
$limiter
private
Limiter
$limiter
$logger
private
LoggerInterface
$logger
$request
private
IRequest
$request
$systemConfig
private
SystemConfig
$systemConfig
$urlGenerator
private
IURLGenerator
$urlGenerator
$userSession
private
IUserSession
$userSession
Methods
__construct()
public
__construct(IClientService $clientService, LoggerInterface $logger, SystemConfig $systemConfig, IAppDataFactory $appDataFactory, IURLGenerator $urlGenerator, Limiter $limiter, IUserSession $userSession, IRequest $request) : mixed
Parameters
- $clientService : IClientService
- $logger : LoggerInterface
- $systemConfig : SystemConfig
- $appDataFactory : IAppDataFactory
- $urlGenerator : IURLGenerator
- $limiter : Limiter
- $userSession : IUserSession
- $request : IRequest
Tags
getCacheKey()
Return a custom cache key to be used for caching the metadata This could be for example the current user id if the reference access permissions are different for each user
public
getCacheKey(string $referenceId) : string|null
Parameters
- $referenceId : string
Tags
Return values
string|nullgetCacheKeyPublic()
Return a custom cache key to be used for caching the metadata This could be for example the current sharingToken if the reference access permissions are different for each share
public
getCacheKeyPublic(string $referenceId, string $sharingToken) : string|null
Parameters
- $referenceId : string
- $sharingToken : string
Tags
Return values
string|nullgetCachePrefix()
Return true if the reference metadata can be globally cached
public
getCachePrefix(string $referenceId) : string
Parameters
- $referenceId : string
Tags
Return values
stringmatchReference()
Validate that a given reference identifier matches the current provider
public
matchReference(string $referenceText) : bool
Parameters
- $referenceText : string
Tags
Return values
boolresolveReference()
Return a reference with its metadata for a given reference identifier
public
resolveReference(string $referenceText) : IReference|null
Parameters
- $referenceText : string
Tags
Return values
IReference|nullresolveReferencePublic()
Return a reference with its metadata for a given reference identifier and sharingToken
public
resolveReferencePublic(string $referenceText, string $sharingToken) : IReference|null
Parameters
- $referenceText : string
- $sharingToken : string
Tags
Return values
IReference|nullfetchReference()
Populates the reference with OpenGraph data
private
fetchReference(Reference $reference) : void
Parameters
- $reference : Reference