aboutsummaryrefslogtreecommitdiff
path: root/engine/classes/GenericResult.php
diff options
context:
space:
mode:
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-10-28 19:17:36 +0000
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-10-28 19:17:36 +0000
commit7ddd9521b3f3a397da3b0a6b56238d31414eb4be (patch)
tree6eb6a9a51db5fa0f5d3cc2ec6de29b9e258b12a1 /engine/classes/GenericResult.php
parentbd3484417d170e62bc94e9db81d4ad37e8ddee6a (diff)
downloadelgg-7ddd9521b3f3a397da3b0a6b56238d31414eb4be.tar.gz
elgg-7ddd9521b3f3a397da3b0a6b56238d31414eb4be.tar.bz2
Standardized code in all of core, not including language files, tests, or core mods.
git-svn-id: http://code.elgg.org/elgg/trunk@7124 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/classes/GenericResult.php')
-rw-r--r--engine/classes/GenericResult.php37
1 files changed, 28 insertions, 9 deletions
diff --git a/engine/classes/GenericResult.php b/engine/classes/GenericResult.php
index 746f0522a..bb8a7e76e 100644
--- a/engine/classes/GenericResult.php
+++ b/engine/classes/GenericResult.php
@@ -2,8 +2,8 @@
/**
* GenericResult Result superclass.
*
- * @package Elgg
- * @subpackage Core
+ * @package Elgg.Core
+ * @subpackage WebServicesAPI
*/
abstract class GenericResult {
/**
@@ -30,8 +30,10 @@ abstract class GenericResult {
/**
* Set a status code and optional message.
*
- * @param int $status The status code.
+ * @param int $status The status code.
* @param string $message The message.
+ *
+ * @return void
*/
protected function setStatusCode($status, $message = "") {
$this->status_code = $status;
@@ -41,20 +43,37 @@ abstract class GenericResult {
/**
* Set the result.
*
- * @param mixed $result
+ * @param mixed $result The result
+ *
+ * @return void
*/
protected function setResult($result) {
$this->result = $result;
}
+ /**
+ * Return the current status code
+ *
+ * @return string
+ */
protected function getStatusCode() {
return $this->status_code;
}
+ /**
+ * Return the current status message
+ *
+ * @return string
+ */
protected function getStatusMessage() {
return $this->message;
}
+ /**
+ * Return the current result
+ *
+ * @return string
+ */
protected function getResult() {
return $this->result;
}
@@ -68,11 +87,11 @@ abstract class GenericResult {
*
* Therefore, I'm not bothering.
*
- * Override this to include any more specific information, however api results should be attached to the
- * class using setResult().
+ * Override this to include any more specific information, however api results
+ * should be attached to the class using setResult().
*
- * if $CONFIG->debug is set then additional information about the runtime environment and authentication will be
- * returned.
+ * if $CONFIG->debug is set then additional information about the runtime environment and
+ * authentication will be returned.
*
* @return stdClass Object containing the serialised result.
*/
@@ -82,7 +101,7 @@ abstract class GenericResult {
$result = new stdClass;
$result->status = $this->getStatusCode();
- if ($this->getStatusMessage()!="") {
+ if ($this->getStatusMessage() != "") {
$result->message = $this->getStatusMessage();
}