From 4d5b2ca7e395fe3d3c1eaeed7bf362e5e8bd137b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vernet=20Lo=C3=AFc?= Date: Mon, 26 Oct 2020 14:50:50 +0100 Subject: [PATCH] data provider: added missing context --- core/data-providers.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/data-providers.md b/core/data-providers.md index ad5ad383b74..c4175713498 100644 --- a/core/data-providers.md +++ b/core/data-providers.md @@ -38,19 +38,19 @@ If no data is available, you should return an empty array. namespace App\DataProvider; -use ApiPlatform\Core\DataProvider\CollectionDataProviderInterface; +use ApiPlatform\Core\DataProvider\ContextAwareCollectionDataProviderInterface; use ApiPlatform\Core\DataProvider\RestrictedDataProviderInterface; use ApiPlatform\Core\Exception\ResourceClassNotSupportedException; use App\Entity\BlogPost; -final class BlogPostCollectionDataProvider implements CollectionDataProviderInterface, RestrictedDataProviderInterface +final class BlogPostCollectionDataProvider implements ContextAwareCollectionDataProviderInterface, RestrictedDataProviderInterface { public function supports(string $resourceClass, string $operationName = null, array $context = []): bool { return BlogPost::class === $resourceClass; } - public function getCollection(string $resourceClass, string $operationName = null): \Generator + public function getCollection(string $resourceClass, string $operationName = null, array $context = []): iterable { // Retrieve the blog post collection from somewhere yield new BlogPost(1);