class OptimisticLockException extends RuntimeException implements ORMException (View source)

An OptimisticLockException is thrown when a version check on an object that uses optimistic locking through a version field fails.

Methods

__construct(string $msg, object $entity)

No description

object|null
getEntity()

Gets the entity that caused the exception.

lockFailed(object $entity)

No description

lockFailedVersionMismatch(object $entity, int $expectedLockVersion, int $actualLockVersion)

No description

notVersioned(string $entityName)

No description

Details

__construct(string $msg, object $entity)

Parameters

string $msg
object $entity

object|null getEntity()

Gets the entity that caused the exception.

Return Value

object|null

static OptimisticLockException lockFailed(object $entity)

Parameters

object $entity

Return Value

OptimisticLockException

static OptimisticLockException lockFailedVersionMismatch(object $entity, int $expectedLockVersion, int $actualLockVersion)

Parameters

object $entity
int $expectedLockVersion
int $actualLockVersion

Return Value

OptimisticLockException

static OptimisticLockException notVersioned(string $entityName)

Parameters

string $entityName

Return Value

OptimisticLockException