Removed unnecessary is_object() check
This commit is contained in:
parent
a4e3921090
commit
f64d6695ce
@ -73,8 +73,8 @@ class OptimisticLockException extends ORMException
|
|||||||
*/
|
*/
|
||||||
public static function lockFailedVersionMismatch($entity, $expectedLockVersion, $actualLockVersion)
|
public static function lockFailedVersionMismatch($entity, $expectedLockVersion, $actualLockVersion)
|
||||||
{
|
{
|
||||||
$expectedLockVersion = (is_object($expectedLockVersion) && $expectedLockVersion instanceof \DateTime) ? $expectedLockVersion->getTimestamp() : $expectedLockVersion;
|
$expectedLockVersion = ($expectedLockVersion instanceof \DateTime) ? $expectedLockVersion->getTimestamp() : $expectedLockVersion;
|
||||||
$actualLockVersion = (is_object($actualLockVersion) && $actualLockVersion instanceof \DateTime) ? $actualLockVersion->getTimestamp() : $actualLockVersion;
|
$actualLockVersion = ($actualLockVersion instanceof \DateTime) ? $actualLockVersion->getTimestamp() : $actualLockVersion;
|
||||||
return new self("The optimistic lock failed, version " . $expectedLockVersion . " was expected, but is actually ".$actualLockVersion, $entity);
|
return new self("The optimistic lock failed, version " . $expectedLockVersion . " was expected, but is actually ".$actualLockVersion, $entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user