ExternalSessionService
extends AbstractDbService
in package
implements
ExternalSessionServiceInterface, DeleteExpiredInterface, DbTableAwareInterface
Uses
DbTableAwareTrait
Database service for external_session table.
Tags
Interfaces, Classes, Traits and Enums
- ExternalSessionServiceInterface
- Database service for external_session table.
- DeleteExpiredInterface
- Interface for exposing the "deleteExpired" method required by command line cleanup tools.
- DbTableAwareInterface
- Marker interface for classes that depend on the \VuFind\Db\Table\PluginManager
Table of Contents
- $tableManager : PluginManager
- Database table plugin manager
- addSessionMapping() : ExternalSessionEntityInterface
- Add a mapping between local and external session id's; return the newly-created entity.
- createEntity() : ExternalSessionEntityInterface
- Create a new external session entity.
- deleteExpired() : int
- Delete expired records. Allows setting a limit so that rows can be deleted in small batches.
- destroySession() : void
- Destroy data for the given session ID.
- getAllByExternalSessionId() : array<string|int, ExternalSessionEntityInterface>
- Retrieve objects from the database based on an external session ID
- getDbTable() : Gateway
- Get a database table object.
- getDbTableManager() : PluginManager
- Get the table plugin manager. Throw an exception if it is missing.
- persistEntity() : void
- Persist an entity.
- setDbTableManager() : void
- Set the table plugin manager.
Properties
$tableManager
Database table plugin manager
protected
PluginManager
$tableManager
Methods
addSessionMapping()
Add a mapping between local and external session id's; return the newly-created entity.
public
addSessionMapping(string $localSessionId, string $externalSessionId) : ExternalSessionEntityInterface
Parameters
- $localSessionId : string
-
Local (VuFind) session id
- $externalSessionId : string
-
External session id
Return values
ExternalSessionEntityInterface —createEntity()
Create a new external session entity.
public
createEntity() : ExternalSessionEntityInterface
Return values
ExternalSessionEntityInterface —deleteExpired()
Delete expired records. Allows setting a limit so that rows can be deleted in small batches.
public
deleteExpired(DateTime $dateLimit[, int|null $limit = null ]) : int
Parameters
- $dateLimit : DateTime
-
Date threshold of an "expired" record.
- $limit : int|null = null
-
Maximum number of rows to delete or null for no limit.
Return values
int —Number of rows deleted
destroySession()
Destroy data for the given session ID.
public
destroySession(string $sid) : void
Parameters
- $sid : string
-
Session ID to erase
Return values
void —getAllByExternalSessionId()
Retrieve objects from the database based on an external session ID
public
getAllByExternalSessionId(string $sid) : array<string|int, ExternalSessionEntityInterface>
Parameters
- $sid : string
-
External session ID to retrieve
Return values
array<string|int, ExternalSessionEntityInterface> —getDbTable()
Get a database table object.
public
getDbTable(string $table) : Gateway
Parameters
- $table : string
-
Table to load.
Return values
Gateway —getDbTableManager()
Get the table plugin manager. Throw an exception if it is missing.
public
getDbTableManager() : PluginManager
Tags
Return values
PluginManager —persistEntity()
Persist an entity.
public
persistEntity(EntityInterface $entity) : void
Parameters
- $entity : EntityInterface
-
Entity to persist.
Return values
void —setDbTableManager()
Set the table plugin manager.
public
setDbTableManager(PluginManager $manager) : void
Parameters
- $manager : PluginManager
-
Plugin manager