PHP Class FactoryGirl\Provider\Doctrine\ORM\Locking\TableLock

See also: transaction()
Afficher le fichier Open project: breerly/factory-girl-php

Méthodes publiques

Méthode Description
__construct ( Repository $repository )
transaction ( integer $lockMode, callback $transaction ) : mixed Attempt to acquire a table level lock in MySQL for the duration of the given transaction. IS NOT IN ANY WAY GUARANTEED TO WORK. MySQL requires that the aliases through which a table is accessed during this transaction are enumerated when locking tables, which due to the nature of Doctrine is a somewhat difficult task. Nevertheless, in simple cases a good guesstimate as to the table aliases can be made; see relevant methods below.

Méthodes protégées

Méthode Description
getRepository ( ) : Repository

Private Methods

Méthode Description
constructLockString ( string $tableName, array $aliases, string $lockModeString ) : string
getLockString ( integer $lockMode ) : string Get the MySQL statement for locking the table underlying this repository for simple read and/or write operations given an appropriate lock mode
getTableAliasGuesstimates ( string $tableName ) : array Attempt to guess at the table name aliases used by Doctrine for a given table name
getTableName ( ) : string
getUnlockString ( ) : string The MySQL statement required to unlock tables after a transaction

Method Details

__construct() public méthode

public __construct ( Repository $repository )
$repository FactoryGirl\Provider\Doctrine\ORM\Repository

getRepository() protected méthode

protected getRepository ( ) : Repository
Résultat FactoryGirl\Provider\Doctrine\ORM\Repository

transaction() public méthode

Attempt to acquire a table level lock in MySQL for the duration of the given transaction. IS NOT IN ANY WAY GUARANTEED TO WORK. MySQL requires that the aliases through which a table is accessed during this transaction are enumerated when locking tables, which due to the nature of Doctrine is a somewhat difficult task. Nevertheless, in simple cases a good guesstimate as to the table aliases can be made; see relevant methods below.
public transaction ( integer $lockMode, callback $transaction ) : mixed
$lockMode integer a TableLockMode constant
$transaction callback
Résultat mixed