VuFind API Documentation

RecordService extends AbstractDbService
in package
implements DbTableAwareInterface, RecordServiceInterface Uses DbTableAwareTrait

Database service for Records.

Tags
category

VuFind

author

Sudharma Kellampalli skellamp@villanova.edu

license

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

link

Wiki

Interfaces, Classes, Traits and Enums

DbTableAwareInterface
Marker interface for classes that depend on the \VuFind\Db\Table\PluginManager
RecordServiceInterface
Database service interface for Records.

Table of Contents

$tableManager  : PluginManager
Database table plugin manager
cleanup()  : int
Clean up orphaned entries (i.e. entries that are not in favorites anymore)
createEntity()  : RecordEntityInterface
Create a record entity object.
deleteRecord()  : bool
Delete a record by source and id. Return true if found and deleted, false if not found.
getDbTable()  : Gateway
Get a database table object.
getDbTableManager()  : PluginManager
Get the table plugin manager. Throw an exception if it is missing.
getRecord()  : RecordEntityInterface|null
Retrieve a record by id.
getRecords()  : array<string|int, RecordEntityInterface>
Retrieve records by ids.
persistEntity()  : void
Persist an entity.
setDbTableManager()  : void
Set the table plugin manager.
updateRecord()  : RecordEntityInterface
Update an existing entry in the record table or create a new one.

Properties

Methods

cleanup()

Clean up orphaned entries (i.e. entries that are not in favorites anymore)

public cleanup() : int
Return values
int

Number of records deleted

deleteRecord()

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

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

Throws exception if something goes wrong.

Parameters
$id : string

Record ID

$source : string

Record source

Tags
throws
Exception
Return values
bool

getDbTable()

Get a database table object.

public getDbTable(string $table) : Gateway
Parameters
$table : string

Table to load.

Return values
Gateway

getRecords()

Retrieve records by ids.

public getRecords(array<string|int, string> $ids, string $source) : array<string|int, RecordEntityInterface>
Parameters
$ids : array<string|int, string>

Record IDs

$source : string

Record source

Return values
array<string|int, RecordEntityInterface>

Array of record objects found

updateRecord()

Update an existing entry in the record table or create a new one.

public updateRecord(string $id, string $source, mixed $rawData) : RecordEntityInterface
Parameters
$id : string

Record ID

$source : string

Data source

$rawData : mixed

Raw data from source (must be serializable)

Return values
RecordEntityInterface

Search results