File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -32,8 +32,10 @@ composer require cybercog/php-db-locker
32
32
``` php
33
33
$dbConnection = new PDO($dsn, $username, $password);
34
34
35
- $postgresLocker = new PostgresAdvisoryLocker();
36
- $postgresLockId = PostgresLockId::fromLockId(new LockId('user', '4'));
35
+ $postgresLocker = new \Cog\DbLocker\Locker\PostgresAdvisoryLocker();
36
+ $postgresLockId = \Cog\DbLocker\LockId\PostgresLockId::fromLockId(
37
+ new LockId('user', '4'),
38
+ );
37
39
38
40
$dbConnection->beginTransaction();
39
41
$isLockAcquired = $postgresLocker->acquireLockWithinTransaction($dbConnection, $postgresLockId);
@@ -50,8 +52,10 @@ $dbConnection->commit();
50
52
``` php
51
53
$dbConnection = new PDO($dsn, $username, $password);
52
54
53
- $postgresLocker = new PostgresAdvisoryLocker();
54
- $postgresLockId = PostgresLockId::fromLockId(new LockId('user', '4'));
55
+ $postgresLocker = new \Cog\DbLocker\Locker\PostgresAdvisoryLocker();
56
+ $postgresLockId = \Cog\DbLocker\LockId\PostgresLockId::fromLockId(
57
+ new LockId('user', '4'),
58
+ );
55
59
56
60
$isLockAcquired = $postgresLocker->acquireLock($dbConnection, $postgresLockId);
57
61
if ($isLockAcquired) {
You can’t perform that action at this time.
0 commit comments