\acdhOeaw\fedoraFedoraCache

Provides FedoraResources cache (e.g. for a given Fedora object)

Summary

Methods
Properties
Constants
__construct()
deleteByUri()
deleteById()
delete()
reload()
add()
getById()
getByUri()
getByMeta()
getByObj()
refresh()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
$id2uri
$uri2id
$cache
N/A

Properties

$id2uri

$id2uri : array

Id to URI mappings

Type

array

$uri2id

$uri2id : array

URI to id mappings

Type

array

$cache

$cache : array

Resources cache

Type

array

Methods

__construct()

__construct() 

deleteByUri()

deleteByUri(string  $uri) 

Removes given resource from cache.

Parameters

string $uri

resource URI

deleteById()

deleteById(string  $id) 

Removes resource with a given internal id from cache.

Parameters

string $id

resource repo internal id

Throws

\acdhOeaw\fedora\exceptions\NotInCache

add()

add(\acdhOeaw\fedora\FedoraResource  $res) 

Adds given object to the cache.

Parameters

\acdhOeaw\fedora\FedoraResource $res

resource object

Throws

\acdhOeaw\fedora\exceptions\AlreadyInCache
\acdhOeaw\fedora\exceptions\NotFound
\acdhOeaw\fedora\exceptions\Deleted
\GuzzleHttp\Exception\ClientException

getById()

getById(string  $id) : \acdhOeaw\fedora\FedoraResource

Gets a resource from cache by its repo internal id.

Parameters

string $id

resource's repo internal id

Throws

\acdhOeaw\fedora\exceptions\NotInCache

Returns

\acdhOeaw\fedora\FedoraResource

getByUri()

getByUri(string  $uri) : \acdhOeaw\fedora\FedoraResource

Gets a resource from cache by its URI.

Parameters

string $uri

resource URI

Throws

\acdhOeaw\fedora\exceptions\NotInCache

Returns

\acdhOeaw\fedora\FedoraResource

getByMeta()

getByMeta(Resource  $meta) : \acdhOeaw\fedora\FedoraResource

Gets resource from cache matchin on any identifier (metadata id property).

Parameters

Resource $meta

resource's metadata

Throws

\acdhOeaw\fedora\exceptions\NotInCache
\acdhOeaw\fedora\exceptions\CacheInconsistent

Returns

\acdhOeaw\fedora\FedoraResource

getByObj()

getByObj(\acdhOeaw\schema\SchemaObject  $obj) : \acdhOeaw\fedora\FedoraResource

Gets resource from cache matchin on any identifier (metadata id property).

Parameters

\acdhOeaw\schema\SchemaObject $obj

object able to provide metadata using a getMetadata() method.

Returns

\acdhOeaw\fedora\FedoraResource

refresh()

refresh() 

Refreshes cache content (reloads existing resources, removes resources which no longer exist)