Documentation

NoProvider extends Provider
in package

Helper type used to indicate the absence of a (selected) Provider

Table of Contents

Properties

$configs  : array<string|int, mixed>
$download_endpoint  : string
$id  : int
$lang  : array<string|int, mixed>
$name  : string
$temp_dir_path  : string
$warning  : string

Methods

__construct()  : mixed
allowViewPage()  : bool
Determine if the Provider should show the view page when clicking on the search result preview image
buildConfigPageDefinition()  : array<string|int, mixed>
Add configuration needs to the image_banks' setup page
checkDependencies()  : array<string|int, mixed>
Allow each provider to register its own dependency checks.
findById()  : ProviderResult
Find Image Bank record by ID.
getAllowedDownloadEndpoint()  : mixed
getDownloadFileInfo()  : SplFileInfo
Get file information for download or when creating a new resource based on a Providers' source file.
getId()  : mixed
getImageMetadata()  : array<string, string>
Retrieve image metadata from Image Bank Provider.
getImageNonMetadataProperties()  : array<string, string>
Retrieve non-metadata properties from Image Bank Provider for image ID.
getName()  : mixed
getResourceDownloadOptionsTable()  : array<string|int, mixed>
Get table view information for rendering on the plugins' view page
getSortOptions()  : array<string|int, mixed>
Get the Providers' sort options which should be displayed on the search page
getTempDirPath()  : string
Get Image Bank providers' temporary directory path
registerConfigurationNeeds()  : void
Register configuration options required by the Provider in the GLOBAL scope
runSearch()  : ProviderSearchResults
Search providers' database based on specified keywords
search()  : ProviderSearchResults
Search providers' database based on specified keywords
getCache()  : bool|string
Get Cache from the providers' temporary directory
setCache()  : void
Set cache in the providers' temporary directory

Properties

Methods

__construct()

public __construct(array<string|int, mixed> $lang, string $temp_dir_path) : mixed
Parameters
$lang : array<string|int, mixed>
$temp_dir_path : string

allowViewPage()

Determine if the Provider should show the view page when clicking on the search result preview image

public allowViewPage() : bool
Return values
bool

buildConfigPageDefinition()

Add configuration needs to the image_banks' setup page

public buildConfigPageDefinition(array<string|int, mixed> $page_def) : array<string|int, mixed>
Parameters
$page_def : array<string|int, mixed>

Setup page definitions config_functions.php

Tags
inheritdoc
Return values
array<string|int, mixed>

checkDependencies()

Allow each provider to register its own dependency checks.

public checkDependencies() : array<string|int, mixed>
Tags
inheritdoc
Return values
array<string|int, mixed>

List of failed (system) dependencies.

getAllowedDownloadEndpoint()

public final getAllowedDownloadEndpoint() : mixed

getDownloadFileInfo()

Get file information for download or when creating a new resource based on a Providers' source file.

public getDownloadFileInfo(string $file) : SplFileInfo
Parameters
$file : string

The source file URL

Tags
inheritdoc
Return values
SplFileInfo

getImageMetadata()

Retrieve image metadata from Image Bank Provider.

public getImageMetadata(int|string $id) : array<string, string>
Parameters
$id : int|string

Record ID

Return values
array<string, string>

The returned key must be the user friendly name (label), the value is just that.

getImageNonMetadataProperties()

Retrieve non-metadata properties from Image Bank Provider for image ID.

public getImageNonMetadataProperties(int|string $id) : array<string, string>
Parameters
$id : int|string

Record ID

Return values
array<string, string>

The returned key must be the user friendly name (label), the value is just that.

getResourceDownloadOptionsTable()

Get table view information for rendering on the plugins' view page

public getResourceDownloadOptionsTable(int|string $id) : array<string|int, mixed>
Parameters
$id : int|string

Record ID

Return values
array<string|int, mixed>

getSortOptions()

Get the Providers' sort options which should be displayed on the search page

public getSortOptions() : array<string|int, mixed>
Return values
array<string|int, mixed>

getTempDirPath()

Get Image Bank providers' temporary directory path

public final getTempDirPath() : string
Return values
string

registerConfigurationNeeds()

Register configuration options required by the Provider in the GLOBAL scope

public final registerConfigurationNeeds(array<string|int, mixed> $globals) : void
Parameters
$globals : array<string|int, mixed>

The globals variable - $GLOBALS

runSearch()

Search providers' database based on specified keywords

public runSearch(mixed $keywords[, mixed $per_page = 24 ][, mixed $page = 1 ][, array<string|int, mixed> $ctx = [] ]) : ProviderSearchResults
Parameters
$keywords : mixed

Search keyword(s)

$per_page : mixed = 24

Number of results per page

$page : mixed = 1

Select the page number

$ctx : array<string|int, mixed> = []

Any other search related contextual information specific provider instances might need

Tags
inheritdoc
Return values
ProviderSearchResults

Search providers' database based on specified keywords

public final search(string $keywords[, int $per_page = 24 ][, int $page = 1 ][, array<string|int, mixed> $ctx = [] ]) : ProviderSearchResults
Parameters
$keywords : string

Search keyword(s)

$per_page : int = 24

Number of results per page

$page : int = 1

Select the page number

$ctx : array<string|int, mixed> = []

Any other search related contextual information specific provider instances might need

Return values
ProviderSearchResults

getCache()

Get Cache from the providers' temporary directory

protected final getCache(string $id, int $ttl) : bool|string
Parameters
$id : string

The cache ID. This is also the filename when saved on disk

$ttl : int

The time to live (in hours) of the cache value. This is measured based on the last modified timestamp of the cache file

Return values
bool|string

Returns FALSE if no cache found or the content of the file

setCache()

Set cache in the providers' temporary directory

protected final setCache(string $id, mixed $value) : void
Parameters
$id : string

The cache ID

$value : mixed

The value to store in the file

Tags
throws
Error

if unable to open file

On this page

Search results