From 7ddd9521b3f3a397da3b0a6b56238d31414eb4be Mon Sep 17 00:00:00 2001 From: brettp Date: Thu, 28 Oct 2010 19:17:36 +0000 Subject: 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 --- engine/classes/GenericResult.php | 37 ++++++++++++++++++++++++++++--------- 1 file changed, 28 insertions(+), 9 deletions(-) (limited to 'engine/classes/GenericResult.php') 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(); } -- cgit v1.2.3