Currency.php 906 B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. namespace Webkul\BagistoApi\Models;
  3. use ApiPlatform\Metadata\ApiProperty;
  4. use ApiPlatform\Metadata\ApiResource;
  5. use ApiPlatform\Metadata\Get;
  6. use ApiPlatform\Metadata\GetCollection;
  7. use ApiPlatform\Metadata\GraphQl\Query;
  8. use ApiPlatform\Metadata\GraphQl\QueryCollection;
  9. use Webkul\BagistoApi\Resolver\BaseQueryItemResolver;
  10. use Webkul\BagistoApi\State\CursorAwareCollectionProvider;
  11. #[ApiResource(
  12. routePrefix: '/api/shop',
  13. operations: [
  14. new Get,
  15. new GetCollection,
  16. ],
  17. graphQlOperations: [
  18. new Query(resolver: BaseQueryItemResolver::class),
  19. new QueryCollection(provider: CursorAwareCollectionProvider::class),
  20. ]
  21. )]
  22. class Currency extends \Webkul\Core\Models\Currency
  23. {
  24. /**
  25. * API Platform identifier
  26. */
  27. #[ApiProperty(identifier: true, writable: false)]
  28. public function getId(): int
  29. {
  30. return $this->id;
  31. }
  32. }