iCompose.php 921 B

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. namespace Luracast\Restler;
  3. use Exception;
  4. /**
  5. * Interface for composing response
  6. *
  7. * @category Framework
  8. * @package Restler
  9. * @subpackage result
  10. * @author R.Arul Kumaran <arul@luracast.com>
  11. * @copyright 2010 Luracast
  12. * @license http://www.opensource.org/licenses/lgpl-license.php LGPL
  13. * @link http://luracast.com/products/restler/
  14. *
  15. */
  16. interface iCompose {
  17. /**
  18. * Result of an api call is passed to this method
  19. * to create a standard structure for the data
  20. *
  21. * @param mixed $result can be a primitive or array or object
  22. */
  23. public function response($result);
  24. /**
  25. * When the api call results in RestException this method
  26. * will be called to return the error message
  27. *
  28. * @param RestException $exception exception that has reasons for failure
  29. *
  30. * @return
  31. */
  32. public function message(RestException $exception);
  33. }