-
-
Notifications
You must be signed in to change notification settings - Fork 233
Expand file tree
/
Copy pathBookRemoveProcessor.php
More file actions
35 lines (30 loc) · 907 Bytes
/
BookRemoveProcessor.php
File metadata and controls
35 lines (30 loc) · 907 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?php
declare(strict_types=1);
namespace App\State\Processor;
use ApiPlatform\Doctrine\Common\State\RemoveProcessor;
use ApiPlatform\Metadata\Operation;
use ApiPlatform\State\ProcessorInterface;
use App\Entity\Book;
use Symfony\Component\DependencyInjection\Attribute\Autowire;
/**
* @implements ProcessorInterface<Book, void>
*/
final readonly class BookRemoveProcessor implements ProcessorInterface
{
/**
* @param RemoveProcessor $removeProcessor
*/
public function __construct(
#[Autowire(service: RemoveProcessor::class)]
private ProcessorInterface $removeProcessor,
) {
}
/**
* @param Book $data
*/
public function process(mixed $data, Operation $operation, array $uriVariables = [], array $context = []): void
{
// remove entity
$this->removeProcessor->process($data, $operation, $uriVariables, $context);
}
}