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: /**
14: * A new success result
15: *
16: * @param string $result The result
17: */
18: public function __construct($result) {
19: $this->setResult($result);
20: $this->setStatusCode(SuccessResult::$RESULT_SUCCESS);
21: }
22:
23: /**
24: * Returns a new instance of this class
25: *
26: * @param unknown $result A result of some kind?
27: *
28: * @return SuccessResult
29: */
30: public static function getInstance($result) {
31: // Return a new error object.
32: return new SuccessResult($result);
33: }
34: }
35: