| 123456789101112131415161718192021222324252627282930313233343536 |
- <?php
- declare(strict_types=1);
- namespace App\DataPersister\Common;
- use ApiPlatform\Core\DataPersister\ContextAwareDataPersisterInterface;
- /**
- * Class OpentalentDataPersister : Décoration du dataPersister par défaut d'API Platform
- * @package App\DataPersister\Common
- */
- final class OpentalentDataPersister implements ContextAwareDataPersisterInterface
- {
- private ContextAwareDataPersisterInterface $decorated;
- public function __construct(ContextAwareDataPersisterInterface $decorated)
- {
- $this->decorated = $decorated;
- }
- public function supports($data, array $context = []): bool
- {
- return $this->decorated->supports($data, $context);
- }
- public function persist($data, array $context = [])
- {
- $result = $this->decorated->persist($data, $context);
- return $result;
- }
- public function remove($data, array $context = [])
- {
- return $this->decorated->remove($data, $context);
- }
- }
|