PHP code example of tourze / symfony-aop-lock-bundle
1. Go to this page and download the library: Download tourze/symfony-aop-lock-bundle library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
tourze / symfony-aop-lock-bundle example snippets
return [
// ... other bundles
Tourze\Symfony\AopLockBundle\AopLockBundle::class => ['all' => true],
];
use Tourze\Symfony\AopLockBundle\Attribute\Lockable;
class OrderService
{
#[Lockable]
public function processOrder(string $orderId): void
{
// business logic
}
#[Lockable(key: "user_{{ userId }}_update")]
public function updateUserProfile(int $userId, array $data): void
{
// business logic
}
}