VuFind API Documentation

ResourceServiceInterface extends DbServiceInterface

Database service interface for resource.

Tags
category

VuFind

author

Demian Katz demian.katz@villanova.edu

author

Sudharma Kellampalli skellamp@villanova.edu

license

http://opensource.org/licenses/gpl-2.0.php GNU General Public License

link

Wiki

Table of Contents

createEntity()  : ResourceEntityInterface
Create a resource entity object.
deleteResource()  : void
Delete a resource entity.
deleteResourceByRecordId()  : bool
Delete a resource by record id and source. Return true if found and deleted, false if not found.
findMissingMetadata()  : array<string|int, ResourceEntityInterface>
Get a set of records that do not have metadata stored in the resource table.
getFavorites()  : array<string|int, ResourceEntityInterface>
Get a set of resources from the requested favorite list.
getResourceById()  : ResourceEntityInterface|null
Lookup and return a resource.
getResourceByRecordId()  : ResourceEntityInterface|null
Retrieve a single resource row by record ID/source. Return null if it does not exist.
getResourcesByRecordIds()  : array<string|int, ResourceEntityInterface>
Retrieve resource entities matching a set of specified records.
persistEntity()  : void
Persist an entity.
renameSource()  : int
Globally change the name of a source value in the database; return the number of rows affected.

Methods

deleteResourceByRecordId()

Delete a resource by record id and source. Return true if found and deleted, false if not found.

public deleteResourceByRecordId(string $id, string $source) : bool

Throws exception if something goes wrong.

Parameters
$id : string

Resource ID

$source : string

Resource source

Tags
throws
Exception
Return values
bool

getFavorites()

Get a set of resources from the requested favorite list.

public getFavorites(UserEntityInterface|int $userOrId[, UserListEntityInterface|int|null $listOrId = null ][, array<string|int, string> $tags = [] ][, string|null $sort = null ], int $offset[, int|null $limit = null ][, bool $caseSensitiveTags = false ]) : array<string|int, ResourceEntityInterface>
Parameters
$userOrId : UserEntityInterface|int

ID of user owning favorite list

$listOrId : UserListEntityInterface|int|null = null

ID of list to retrieve (null for all favorites)

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

Tags to use for limiting results

$sort : string|null = null

Resource table field to use for sorting (null for no particular sort).

$offset : int

Offset for results

$limit : int|null = null

Limit for results (null for none)

$caseSensitiveTags : bool = false

Treat tags as case-sensitive?

Return values
array<string|int, ResourceEntityInterface>

getResourceByRecordId()

Retrieve a single resource row by record ID/source. Return null if it does not exist.

public getResourceByRecordId(string $id[, string $source = DEFAULT_SEARCH_BACKEND ]) : ResourceEntityInterface|null
Parameters
$id : string

Record ID

$source : string = DEFAULT_SEARCH_BACKEND

Record source

Return values
ResourceEntityInterface|null

getResourcesByRecordIds()

Retrieve resource entities matching a set of specified records.

public getResourcesByRecordIds(array<string|int, string> $ids[, string $source = DEFAULT_SEARCH_BACKEND ]) : array<string|int, ResourceEntityInterface>
Parameters
$ids : array<string|int, string>

Array of IDs

$source : string = DEFAULT_SEARCH_BACKEND

Source of records to look up

Return values
array<string|int, ResourceEntityInterface>

renameSource()

Globally change the name of a source value in the database; return the number of rows affected.

public renameSource(string $old, string $new) : int
Parameters
$old : string

Old source value

$new : string

New source value

Return values
int

Search results