File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -38,19 +38,19 @@ If no data is available, you should return an empty array.
38
38
39
39
namespace App\DataProvider;
40
40
41
- use ApiPlatform\Core\DataProvider\CollectionDataProviderInterface ;
41
+ use ApiPlatform\Core\DataProvider\ContextAwareCollectionDataProviderInterface ;
42
42
use ApiPlatform\Core\DataProvider\RestrictedDataProviderInterface;
43
43
use ApiPlatform\Core\Exception\ResourceClassNotSupportedException;
44
44
use App\Entity\BlogPost;
45
45
46
- final class BlogPostCollectionDataProvider implements CollectionDataProviderInterface , RestrictedDataProviderInterface
46
+ final class BlogPostCollectionDataProvider implements ContextAwareCollectionDataProviderInterface , RestrictedDataProviderInterface
47
47
{
48
48
public function supports(string $resourceClass, string $operationName = null, array $context = []): bool
49
49
{
50
50
return BlogPost::class === $resourceClass;
51
51
}
52
52
53
- public function getCollection(string $resourceClass, string $operationName = null): \Generator
53
+ public function getCollection(string $resourceClass, string $operationName = null, array $context = [] ): iterable
54
54
{
55
55
// Retrieve the blog post collection from somewhere
56
56
yield new BlogPost(1);
You can’t perform that action at this time.
0 commit comments