AuthHashService
extends AbstractDbService
in package
implements
AuthHashServiceInterface, DbTableAwareInterface, DeleteExpiredInterface
Uses
DbTableAwareTrait
Database service for auth_hash table.
Tags
Interfaces, Classes, Traits and Enums
- AuthHashServiceInterface
- Database service for auth_hash table.
- DbTableAwareInterface
- Marker interface for classes that depend on the \VuFind\Db\Table\PluginManager
- DeleteExpiredInterface
- Interface for exposing the "deleteExpired" method required by command line cleanup tools.
Table of Contents
- $tableManager : PluginManager
- Database table plugin manager
- createEntity() : AuthHashEntityInterface
- Create an auth_hash entity object.
- deleteAuthHash() : void
- Delete an auth_hash entity object.
- deleteExpired() : int
- Delete expired records. Allows setting a limit so that rows can be deleted in small batches.
- getByHashAndType() : AuthHashEntityInterface|null
- Retrieve an object from the database based on hash and type; possibly create a new row if no existing match is found.
- getDbTable() : Gateway
- Get a database table object.
- getDbTableManager() : PluginManager
- Get the table plugin manager. Throw an exception if it is missing.
- getLatestBySessionId() : AuthHashEntityInterface|null
- Retrieve last object from the database based on session id.
- persistEntity() : void
- Persist an entity.
- setDbTableManager() : void
- Set the table plugin manager.
Properties
$tableManager
Database table plugin manager
protected
PluginManager
$tableManager
Methods
createEntity()
Create an auth_hash entity object.
public
createEntity() : AuthHashEntityInterface
Return values
AuthHashEntityInterface —deleteAuthHash()
Delete an auth_hash entity object.
public
deleteAuthHash(AuthHashEntityInterface|int $authHashOrId) : void
Parameters
- $authHashOrId : AuthHashEntityInterface|int
-
Object or ID value representing auth_hash to delete
Return values
void —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
getByHashAndType()
Retrieve an object from the database based on hash and type; possibly create a new row if no existing match is found.
public
getByHashAndType(string $hash, string $type[, bool $create = true ]) : AuthHashEntityInterface|null
Parameters
- $hash : string
-
Hash
- $type : string
-
Hash type
- $create : bool = true
-
Should we create rows that don't already exist?
Return values
AuthHashEntityInterface|null —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 —getLatestBySessionId()
Retrieve last object from the database based on session id.
public
getLatestBySessionId(string $sessionId) : AuthHashEntityInterface|null
Parameters
- $sessionId : string
-
Session ID
Return values
AuthHashEntityInterface|null —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