Transaction
in package
Uses
RunTestsTrait
Tags
Table of Contents
Constants
- DB_LOCK_TIMEOUT = 1000
Properties
- $log : LoggerInterface|null
- $ontology : Ontology
- $parentIds : array<string|int, int>
- Stores ids of all pre-transaction parents of resources affected by the current transaction
- $pdo : PDO
- $schema : Schema
- $txId : int
Methods
- __construct() : mixed
- checkAutoCreatedResources() : void
- checkEmptyCollections() : void
- checkHasNextItem() : void
- checkIsNewVersionOf() : void
- isNewVersionOf can't create cycles so creation of the 2nd (and higher order) isNewVersionOf links to a resource is forbidden.
- onTxCommit() : void
- runTests() : array<string|int, DoorkeeperException>|null
- updateCollections() : void
- fetchPreTransactionParentIds() : array<string|int, int>
- Returns ids of all pre-transaction parents of resources affected by the current transaction
- updateCollectionAggregates() : void
- updateCollectionSize() : void
Constants
DB_LOCK_TIMEOUT
public
mixed
DB_LOCK_TIMEOUT
= 1000
Properties
$log
private
LoggerInterface|null
$log
= null
$ontology
private
Ontology
$ontology
$parentIds
Stores ids of all pre-transaction parents of resources affected by the current transaction
private
array<string|int, int>
$parentIds
$pdo
private
PDO
$pdo
$schema
private
Schema
$schema
$txId
private
int
$txId
Methods
__construct()
public
__construct(int $txId, PDO $pdo, Schema $schema, Ontology $ontology[, LoggerInterface|null $log = null ]) : mixed
Parameters
checkAutoCreatedResources()
public
checkAutoCreatedResources() : void
Tags
checkEmptyCollections()
public
checkEmptyCollections() : void
Tags
checkHasNextItem()
public
checkHasNextItem() : void
Tags
checkIsNewVersionOf()
isNewVersionOf can't create cycles so creation of the 2nd (and higher order) isNewVersionOf links to a resource is forbidden.
public
checkIsNewVersionOf() : void
As the doorkeeper can't lock resources in an effective way checking it is possible only at the transaction commit.
Tags
onTxCommit()
public
static onTxCommit(string $method, int $txId, array<string|int, int> $resourceIds) : void
Parameters
- $method : string
- $txId : int
- $resourceIds : array<string|int, int>
Tags
runTests()
public
runTests([string $attribute = CheckAttribute::class ][, int $filter = ReflectionMethod::IS_PUBLIC ][, bool $throwException = true ]) : array<string|int, DoorkeeperException>|null
Parameters
- $attribute : string = CheckAttribute::class
- $filter : int = ReflectionMethod::IS_PUBLIC
- $throwException : bool = true
-
if
true
, the method throws a DoorkeeperException on errors or null otherwise. Iffalse
, method returns a (possibly empty) array of DoorkeeperExceptions.
Return values
array<string|int, DoorkeeperException>|nullupdateCollections()
public
updateCollections() : void
Tags
fetchPreTransactionParentIds()
Returns ids of all pre-transaction parents of resources affected by the current transaction
private
fetchPreTransactionParentIds() : array<string|int, int>
Return values
array<string|int, int>updateCollectionAggregates()
private
updateCollectionAggregates() : void
updateCollectionSize()
private
updateCollectionSize() : void