com\setasign\SetaFramework\Registry

PersistantDatabase Class PersistantDatabase

File: /SetaFramework/src/Registry/PersistantDatabase.php

Class hierarchy

Implements

  • \Psr\Log\LoggerAwareInterface

Summary

Constants

FLAG_NOWAIT

LOCK_READ

private const PersistantDatabase::LOCK_READ = 1

LOCK_WRITE

private const PersistantDatabase::LOCK_WRITE = 2

Properties

$lock

protected ?int PersistantDatabase::$lock

$logger

protected ?\Psr\Log\LoggerInterface PersistantDatabase::$logger

$registryName

$transactionId

The id of the transaction in which the lock was created. Only needed if no own transaction is used.


Static Methods

setupTable()

public static PersistantDatabase::setupTable (
\com\setasign\SetaFramework\Database\Manager\TableSchemaBuilder $tableSchemaBuilder,
string $tableName = 'persistant_registry'
): void
Parameters
$tableSchemaBuilder : \com\setasign\SetaFramework\Database\Manager\TableSchemaBuilder
 
$tableName : string
 
Exceptions

Throws \com\setasign\SetaFramework\Database\Manager\TableSchemaBuilderException


Methods

__construct()

endRead()

public PersistantDatabase::endRead (
void
): void
Exceptions

Throws \com\setasign\SetaFramework\Exception

fetchRegistryWithLock()

private PersistantDatabase::fetchRegistryWithLock (
int $lock,
bool $allowWait = true
): void
Parameters
$lock : int
 
$allowWait : bool
 

hasReadLock()

public PersistantDatabase::hasReadLock (
void
): bool

Checks whether the registry has actually a read lock.

hasWriteLock()

public PersistantDatabase::hasWriteLock (
void
): bool

Checks whether the registry has actually a write lock.

read()

public PersistantDatabase::read (
callable $callback,
int $options = 0
): void
Parameters
$callback : callable
 
$options : int
 
Exceptions

Throws \Throwable

readProcess()

Exceptions

Throws \com\setasign\SetaFramework\Exception If the registry data cannot be read.

setLogger()

public PersistantDatabase::setLogger (
\Psr\Log\LoggerInterface $logger
): void

Sets a logger instance on the object.

Parameters
$logger : \Psr\Log\LoggerInterface
 

startRead()

public PersistantDatabase::startRead (
int $options = 0
): Registry
Parameters
$options : int
 
Exceptions

Throws \Throwable

startReadWithExternalTransaction()

Parameters
$options : int
 
Exceptions

Throws \com\setasign\SetaFramework\Exception

write()

public PersistantDatabase::write (
callable $callback,
int $options = 0
): void
Parameters
$callback : callable
 
$options : int
 
Exceptions

Throws \Throwable Any exceptions which is thrown in the callback.

writeProcess()

private PersistantDatabase::writeProcess (
Registry $registry
): void
Parameters
$registry : Registry
 
Exceptions

Throws \com\setasign\SetaFramework\Exception If the registry data cannot be saved.

writeWithExternalTransaction()

public PersistantDatabase::writeWithExternalTransaction (
callable $callback,
int $options = 0
): void
Parameters
$callback : callable
 
$options : int
 
Exceptions

Throws \com\setasign\SetaFramework\Exception