Méthode | Description | |
---|---|---|
getEntityName ( ) : string | ||
getReference ( mixed $identifier ) : object | Gets a reference to the entity identified by the given type and identifier without actually loading it, if the entity is not yet loaded. | |
transaction ( $transaction ) : mixed | Perform a callback function within a transaction. If an exception occurs within the function, it's catched, the transaction is rolled back and the exception rethrown. | |
transactionWithTableLock ( 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. | |
useWithLock ( integer $id, integer $lockMode, $callback ) : mixed | Acquires a lock to an entity, provides the entity to a callback function and relinquishes the lock by flushing the entity manager immediately after. | |
useWithPessimisticVersionLock ( integer $id, mixed $lockVersion, $callback ) : mixed | Acquires an optimistic lock within a pessimistic lock transaction. For use in fail-fast scenarios; guaranteed to throw an exception on concurrent modification attempts. The one to first acquire the write lock will update the version field, leading subsequent acquisitions of the optimistic lock to fail. | |
useWithPessimisticWriteLock ( integer $id, $callback ) : mixed | Calls useWithLock() with a pessimistic write lock mode |
Méthode | Description | |
---|---|---|
getBaseQueryBuilder ( ) : |
Create a query builder. Override this in a child class to create a builder of the appropriate type. | |
getQueryResult ( Doctrine\ORM\QueryBuilder $builder ) : mixed | ||
getSingleQueryResult ( Doctrine\ORM\QueryBuilder $builder, callback(Exception) $fallback = null ) : object | null | ||
getSingleScalarQueryResult ( Doctrine\ORM\QueryBuilder $builder, callback(Exception) $fallback = null ) : object | null | ||
withQueryBuilder ( $do ) : |
Create a query builder, perform the given operation on it and return the query builder. The operation callback receives the query builder and its associated expression builder as arguments. |
Méthode | Description | |
---|---|---|
attemptQuery ( callback $do, callback $fallback = null ) : mixed | Guards against NoResultException and NonUniqueResultException within a callback. Uses a fallback callback in case an exception does occur. | |
getTableLock ( ) : |
protected getBaseQueryBuilder ( ) : |
||
Résultat |
protected getQueryResult ( Doctrine\ORM\QueryBuilder $builder ) : mixed | ||
$builder | Doctrine\ORM\QueryBuilder | |
Résultat | mixed | result |
public getReference ( mixed $identifier ) : object | ||
$identifier | mixed | The entity identifier. |
Résultat | object | The entity reference. |
protected getSingleQueryResult ( Doctrine\ORM\QueryBuilder $builder, callback(Exception) $fallback = null ) : object | null | ||
$builder | Doctrine\ORM\QueryBuilder | |
$fallback | callback(Exception) | |
Résultat | object | null | | null result or return value from fallback |
protected getSingleScalarQueryResult ( Doctrine\ORM\QueryBuilder $builder, callback(Exception) $fallback = null ) : object | null | ||
$builder | Doctrine\ORM\QueryBuilder | |
$fallback | callback(Exception) | |
Résultat | object | null | | null result or return value from fallback |
public transaction ( $transaction ) : mixed | ||
Résultat | mixed | the callback return value |
public useWithPessimisticWriteLock ( integer $id, $callback ) : mixed | ||
$id | integer | |
Résultat | mixed | callback return type |
protected withQueryBuilder ( $do ) : |
||
Résultat |