ResourceContainerInterface.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php
  2. /**
  3. * Refer to LICENSE.txt distributed with the Temando Shipping module for notice of license
  4. */
  5. namespace Temando\Shipping\Rest\SchemaMapper\JsonApi;
  6. use Temando\Shipping\Rest\Response\DataObject\AbstractResource;
  7. /**
  8. * Temando REST API JSON API Container Interface
  9. *
  10. * Register deserialized resources
  11. *
  12. * @package Temando\Shipping\Rest
  13. * @author Christoph Aßmann <christoph.assmann@netresearch.de>
  14. * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
  15. * @link http://www.temando.com/
  16. */
  17. interface ResourceContainerInterface
  18. {
  19. /**
  20. * Register a resource
  21. *
  22. * @param AbstractResource $resource
  23. * @return void
  24. */
  25. public function addResource(AbstractResource $resource);
  26. /**
  27. * Obtain a registered resource identified by type and id properties.
  28. *
  29. * @param string $type
  30. * @param string $id
  31. * @return AbstractResource
  32. */
  33. public function getResource($type, $id);
  34. /**
  35. * Obtain all registered resources.
  36. *
  37. * @return AbstractResource[]
  38. */
  39. public function getResources();
  40. }