RecordServiceInterface
extends
DbServiceInterface
in
Database service interface for Records.
Tags
Table of Contents
- 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.
- getRecord() : RecordEntityInterface|null
- Retrieve a record by id.
- getRecords() : array<string|int, RecordEntityInterface>
- Retrieve records by ids.
- persistEntity() : void
- Persist an entity.
- updateRecord() : RecordEntityInterface
- Update an existing entry in the record table or create a new one.
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
createEntity()
Create a record entity object.
public
createEntity() : RecordEntityInterface
Return values
RecordEntityInterface —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
Return values
bool —getRecord()
Retrieve a record by id.
public
getRecord(string $id, string $source) : RecordEntityInterface|null
Parameters
- $id : string
-
Record ID
- $source : string
-
Record source
Return values
RecordEntityInterface|null —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
persistEntity()
Persist an entity.
public
persistEntity(EntityInterface $entity) : void
Parameters
- $entity : EntityInterface
-
Entity to persist.
Return values
void —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)