1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- <?php
-
-
- namespace Doctrine\ORM;
-
-
- class OptimisticLockException extends ORMException
- {
- private $entity;
-
- public function __construct($msg, $entity)
- {
- parent::__construct($msg);
- $this->entity = $entity;
- }
-
-
-
- public function getEntity()
- {
- return $this->entity;
- }
-
- public static function lockFailed($entity)
- {
- return new self("The optimistic lock on an entity failed.", $entity);
- }
-
- public static function lockFailedVersionMissmatch($entity, $expectedLockVersion, $actualLockVersion)
- {
- return new self("The optimistic lock failed, version " . $expectedLockVersion . " was expected, but is actually ".$actualLockVersion, $entity);
- }
-
- public static function notVersioned($entityName)
- {
- return new self("Cannot obtain optimistic lock on unversioned entity " . $entityName, null);
- }
- }
|