SearchServiceInterface
extends
DbServiceInterface
in
Database service interface for search.
Tags
Table of Contents
- cleanUpInvalidUserIds() : int
- Set invalid user_id values in the table to null; return count of affected rows.
- createAndPersistEntityWithChecksum() : SearchEntityInterface
- Create a search entity containing the specified checksum, persist it to the database, and return a fully populated object. Throw an exception if something goes wrong during the process.
- createEntity() : SearchEntityInterface
- Create a search entity.
- destroySession() : void
- Destroy unsaved searches belonging to the specified session/user.
- getSavedSearchesWithMissingChecksums() : array<string|int, SearchEntityInterface>
- Get saved searches with missing checksums (used for cleaning up legacy data).
- getScheduledSearches() : array<string|int, SearchEntityInterface>
- Get scheduled searches.
- getSearchById() : SearchEntityInterface|null
- Get a SearchEntityInterface object by ID.
- getSearchByIdAndOwner() : SearchEntityInterface|null
- Get a SearchEntityInterface object by ID and owner.
- getSearches() : array<string|int, SearchEntityInterface>
- Get an array of rows for the specified user.
- getSearchesByChecksumAndOwner() : array<string|int, SearchEntityInterface>
- Retrieve all searches matching the specified checksum and belonging to the user specified by session or user entity/ID.
- persistEntity() : void
- Persist an entity.
Methods
cleanUpInvalidUserIds()
Set invalid user_id values in the table to null; return count of affected rows.
public
cleanUpInvalidUserIds() : int
Return values
int —createAndPersistEntityWithChecksum()
Create a search entity containing the specified checksum, persist it to the database, and return a fully populated object. Throw an exception if something goes wrong during the process.
public
createAndPersistEntityWithChecksum(int $checksum) : SearchEntityInterface
Parameters
- $checksum : int
-
Checksum
Tags
Return values
SearchEntityInterface —createEntity()
Create a search entity.
public
createEntity() : SearchEntityInterface
Return values
SearchEntityInterface —destroySession()
Destroy unsaved searches belonging to the specified session/user.
public
destroySession(string $sessionId[, UserEntityInterface|int|null $userOrId = null ]) : void
Parameters
- $sessionId : string
-
Session ID of current user.
- $userOrId : UserEntityInterface|int|null = null
-
User entity or ID of current user (optional).
Return values
void —getSavedSearchesWithMissingChecksums()
Get saved searches with missing checksums (used for cleaning up legacy data).
public
getSavedSearchesWithMissingChecksums() : array<string|int, SearchEntityInterface>
Return values
array<string|int, SearchEntityInterface> —getScheduledSearches()
Get scheduled searches.
public
getScheduledSearches() : array<string|int, SearchEntityInterface>
Return values
array<string|int, SearchEntityInterface> —getSearchById()
Get a SearchEntityInterface object by ID.
public
getSearchById(int $id) : SearchEntityInterface|null
Parameters
- $id : int
-
Search identifier
Return values
SearchEntityInterface|null —getSearchByIdAndOwner()
Get a SearchEntityInterface object by ID and owner.
public
getSearchByIdAndOwner(int $id, string $sessionId, UserEntityInterface|int|null $userOrId) : SearchEntityInterface|null
Parameters
- $id : int
-
Search identifier
- $sessionId : string
-
Session ID of current user.
- $userOrId : UserEntityInterface|int|null
-
User entity or ID of current user (optional).
Return values
SearchEntityInterface|null —getSearches()
Get an array of rows for the specified user.
public
getSearches(string $sessionId[, UserEntityInterface|int|null $userOrId = null ]) : array<string|int, SearchEntityInterface>
Parameters
- $sessionId : string
-
Session ID of current user.
- $userOrId : UserEntityInterface|int|null = null
-
User entity or ID of current user (optional).
Return values
array<string|int, SearchEntityInterface> —getSearchesByChecksumAndOwner()
Retrieve all searches matching the specified checksum and belonging to the user specified by session or user entity/ID.
public
getSearchesByChecksumAndOwner(int $checksum, string $sessionId[, UserEntityInterface|int|null $userOrId = null ]) : array<string|int, SearchEntityInterface>
Parameters
- $checksum : int
-
Checksum to match
- $sessionId : string
-
Current session ID
- $userOrId : UserEntityInterface|int|null = null
-
Entity or ID representing current user (optional).
Tags
Return values
array<string|int, SearchEntityInterface> —persistEntity()
Persist an entity.
public
persistEntity(EntityInterface $entity) : void
Parameters
- $entity : EntityInterface
-
Entity to persist.