Skip to content

PdoSessionFactory

session slot factory for this package’s PdoSessionPersistence.

yaml session: class: Quiote\Session\Pdo\PdoSessionFactory params: database: sessions table: session

Core ships an equivalent pair (PdoSessionFactory over PdoSessionPersistence) with no extra dependency, and that is the one to reach for in a new application. This exists so an application already requiring this package keeps working.

final class PdoSessionFactory implements SessionFactoryInterface

ImplementsSessionFactoryInterface
Since3.0.0
SourcePdoSessionFactory.php
MethodDescription
createPersistence(Context $context, array $parameters): SessionPersistenceInterfaceBuilds a PdoSessionPersistence over a connection from the application’s database manager.

public function createPersistence(Context $context, array $parameters): SessionPersistenceInterface

Builds a PdoSessionPersistence over a connection from the application’s database manager.

The database parameter names the connection; omitting it takes the default one. table defaults to session.

ParameterTypeDescription
$contextContext
$parametersarray

Returns SessionPersistenceInterface

ThrowsWhen
StorageExceptionif no database manager is bound (core.use_database off) or the named connection is not a PDO handle.