VuFind API Documentation

ChangeTrackerServiceInterface extends DbServiceInterface

Database service interface for change tracker.

Tags
category

VuFind

author

Sudharma Kellampalli skellamp@villanova.edu

author

Demian Katz demian.katz@villanova.edu

license

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

link

Wiki

Table of Contents

getChangeTrackerEntity()  : ChangeTrackerEntityInterface|null
Retrieve a row from the database based on primary key; return null if it is not found.
getDeletedCount()  : int
Retrieve a count of deleted rows from the database.
getDeletedEntities()  : array<string|int, ChangeTrackerEntityInterface>
Retrieve a set of deleted rows from the database.
index()  : ChangeTrackerEntityInterface
Update the change_tracker table to reflect that a record has been indexed.
markDeleted()  : ChangeTrackerEntityInterface
Update the change tracker table to indicate that a record has been deleted.
persistEntity()  : void
Persist an entity.

Methods

getDeletedCount()

Retrieve a count of deleted rows from the database.

public getDeletedCount(string $indexName, DateTime $from, DateTime $until) : int
Parameters
$indexName : string

The name of the Solr index holding the record.

$from : DateTime

The beginning date of the range to search.

$until : DateTime

The end date of the range to search.

Return values
int

getDeletedEntities()

Retrieve a set of deleted rows from the database.

public getDeletedEntities(string $indexName, DateTime $from, DateTime $until, int $offset[, int|null $limit = null ]) : array<string|int, ChangeTrackerEntityInterface>
Parameters
$indexName : string

The name of the Solr index holding the record.

$from : DateTime

The beginning date of the range to search.

$until : DateTime

The end date of the range to search.

$offset : int

Record number to retrieve first.

$limit : int|null = null

Retrieval limit (null for no limit)

Return values
array<string|int, ChangeTrackerEntityInterface>

index()

Update the change_tracker table to reflect that a record has been indexed.

public index(string $core, string $id, int $change) : ChangeTrackerEntityInterface

We need to know the date of the last change to the record (independent of its addition to the index) in order to tell the difference between a reindex of a previously-encountered record and a genuine change.

The method returns the updated/created row when complete.

Parameters
$core : string

The Solr core holding the record.

$id : string

The ID of the record being indexed.

$change : int

The timestamp of the last record change.

Return values
ChangeTrackerEntityInterface

Search results