PHP Класс FactoryGirl\Provider\Doctrine\ORM\Repository

Наследование: extends Doctrine\ORM\EntityRepository
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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

Защищенные методы

Метод Описание
getBaseQueryBuilder ( ) : QueryBuilder 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 ) : QueryBuilder 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.

Приватные методы

Метод Описание
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 ( ) : TableLock

Описание методов

getBaseQueryBuilder() защищенный Метод

Create a query builder. Override this in a child class to create a builder of the appropriate type.
protected getBaseQueryBuilder ( ) : QueryBuilder
Результат QueryBuilder

getEntityName() публичный Метод

public getEntityName ( ) : string
Результат string

getQueryResult() защищенный Метод

protected getQueryResult ( Doctrine\ORM\QueryBuilder $builder ) : mixed
$builder Doctrine\ORM\QueryBuilder
Результат mixed result

getReference() публичный Метод

Gets a reference to the entity identified by the given type and identifier without actually loading it, if the entity is not yet loaded.
public getReference ( mixed $identifier ) : object
$identifier mixed The entity identifier.
Результат object The entity reference.

getSingleQueryResult() защищенный Метод

protected getSingleQueryResult ( Doctrine\ORM\QueryBuilder $builder, callback(Exception) $fallback = null ) : object | null
$builder Doctrine\ORM\QueryBuilder
$fallback callback(Exception)
Результат object | null | null result or return value from fallback

getSingleScalarQueryResult() защищенный Метод

protected getSingleScalarQueryResult ( Doctrine\ORM\QueryBuilder $builder, callback(Exception) $fallback = null ) : object | null
$builder Doctrine\ORM\QueryBuilder
$fallback callback(Exception)
Результат object | null | null result or return value from fallback

transaction() публичный Метод

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.
public transaction ( $transaction ) : mixed
Результат mixed the callback return value

transactionWithTableLock() публичный Метод

Attempt to acquire a table level lock in MySQL for the duration of the given transaction. IS NOT IN ANY WAY GUARANTEED TO WORK.
См. также: TableLock
public transactionWithTableLock ( integer $lockMode, callback $transaction ) : mixed
$lockMode integer a TableLockMode constant
$transaction callback
Результат mixed

useWithLock() публичный Метод

Acquires a lock to an entity, provides the entity to a callback function and relinquishes the lock by flushing the entity manager immediately after.
public useWithLock ( integer $id, integer $lockMode, $callback ) : mixed
$id integer
$lockMode integer
Результат mixed callback return type

useWithPessimisticVersionLock() публичный Метод

FIXME: Only works on entities implementing VersionLockable and does not work in conjunction with the Doctrine @Version column.
public useWithPessimisticVersionLock ( integer $id, mixed $lockVersion, $callback ) : mixed
$id integer
$lockVersion mixed
Результат mixed callback return type

useWithPessimisticWriteLock() публичный Метод

Calls useWithLock() with a pessimistic write lock mode
public useWithPessimisticWriteLock ( integer $id, $callback ) : mixed
$id integer
Результат mixed callback return type

withQueryBuilder() защищенный Метод

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.
protected withQueryBuilder ( $do ) : QueryBuilder
Результат QueryBuilder