SuccessResult.php 738 B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. /**
  3. * SuccessResult
  4. * Generic success result class, extend if you want to do something special.
  5. *
  6. * @package Elgg.Core
  7. * @subpackage WebServicesAPI
  8. */
  9. class SuccessResult extends GenericResult {
  10. // Do not change this from 0
  11. public static $RESULT_SUCCESS = 0;
  12. /**
  13. * A new success result
  14. *
  15. * @param string $result The result
  16. */
  17. public function __construct($result) {
  18. $this->setResult($result);
  19. $this->setStatusCode(SuccessResult::$RESULT_SUCCESS);
  20. }
  21. /**
  22. * Returns a new instance of this class
  23. *
  24. * @param unknown $result A result of some kind?
  25. *
  26. * @return SuccessResult
  27. */
  28. public static function getInstance($result) {
  29. // Return a new error object.
  30. return new SuccessResult($result);
  31. }
  32. }