vendor/api-platform/core/src/Core/DataProvider/RestrictDataProviderTrait.php line 21

Open in your IDE?
  1. <?php
  2. /*
  3. * This file is part of the API Platform project.
  4. *
  5. * (c) Kévin Dunglas <dunglas@gmail.com>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. declare(strict_types=1);
  11. namespace ApiPlatform\Core\DataProvider;
  12. trait RestrictDataProviderTrait
  13. {
  14. /** @internal */
  15. public $dataProviders = [];
  16. public function supports(string $resourceClass, string $operationName = null, array $context = []): bool
  17. {
  18. foreach ($this->dataProviders as $dataProvider) {
  19. if ($dataProvider instanceof RestrictedDataProviderInterface
  20. && $dataProvider->supports($resourceClass, $operationName, $context)) {
  21. return true;
  22. }
  23. }
  24. return false;
  25. }
  26. }