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
- 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() : void
- updateCollections() : void
- fetchParentIds() : 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
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 ]) : void
Parameters
- $attribute : string = CheckAttribute::class
- $filter : int = ReflectionMethod::IS_PUBLIC
updateCollections()
public
updateCollections() : void
Tags
fetchParentIds()
Returns ids of all pre-transaction parents of resources affected by the current transaction
private
fetchParentIds() : array<string|int, int>
Return values
array<string|int, int>updateCollectionAggregates()
private
updateCollectionAggregates() : void
updateCollectionSize()
private
updateCollectionSize() : void