update documentation for global batch actions
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
parent
5142ac39ab
commit
690d7fd31b
|
@ -323,14 +323,15 @@ Do not use the same action in global and classic batch action.
|
|||
The callback can return a response. If not, the user will be redirect automatically. See the example below:
|
||||
|
||||
```php-inline
|
||||
use App\Core\Entity\EntityInterface;
|
||||
use App\Core\Entity\RepositoryQuery;
|
||||
use App\Core\Manager\EntityManager;
|
||||
use Symfony\Component\HttpFoundation\JsonResponse;
|
||||
|
||||
$configuration->setGlobalBatchAction(
|
||||
'index',
|
||||
'export_json',
|
||||
'Export to JSON',
|
||||
function(RepositoryQuery $query, EntityManager $manager, ?array $selection): ?Response {
|
||||
function(RepositoryQuery $query, EntityManager $manager, ?array $selection): JsonResponse {
|
||||
$items = $selection ?? $query->find();
|
||||
|
||||
return $this->json($items);
|
||||
|
|
Loading…
Reference in a new issue