ChangeTrackerServiceInterface
extends
DbServiceInterface
in
Database service interface for change tracker.
Tags
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
getChangeTrackerEntity()
Retrieve a row from the database based on primary key; return null if it is not found.
public
getChangeTrackerEntity(string $indexName, string $id) : ChangeTrackerEntityInterface|null
Parameters
- $indexName : string
-
The name of the Solr index holding the record.
- $id : string
-
The ID of the record being indexed.
Return values
ChangeTrackerEntityInterface|null —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 —markDeleted()
Update the change tracker table to indicate that a record has been deleted.
public
markDeleted(string $core, string $id) : ChangeTrackerEntityInterface
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.
Return values
ChangeTrackerEntityInterface —persistEntity()
Persist an entity.
public
persistEntity(EntityInterface $entity) : void
Parameters
- $entity : EntityInterface
-
Entity to persist.