diff options
author | Fabio Bas <ctrlaltca@gmail.com> | 2015-01-20 22:12:46 +0100 |
---|---|---|
committer | Fabio Bas <ctrlaltca@gmail.com> | 2015-01-20 22:12:46 +0100 |
commit | 7254793d2bbe3f2f3d87d97172c54a54deea0a3a (patch) | |
tree | 696f734b5f0fad620f459a4639e269bffad4444d /framework/Web/Services/TJsonResponse.php | |
parent | 6a77820f00da900f2355e16ef9aa77cd132fb423 (diff) |
One class per file: framework/Web/Services
Diffstat (limited to 'framework/Web/Services/TJsonResponse.php')
-rw-r--r-- | framework/Web/Services/TJsonResponse.php | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/framework/Web/Services/TJsonResponse.php b/framework/Web/Services/TJsonResponse.php new file mode 100644 index 00000000..496229f5 --- /dev/null +++ b/framework/Web/Services/TJsonResponse.php @@ -0,0 +1,57 @@ +<?php +/** + * TJsonService and TJsonResponse class file. + * + * @author Wei Zhuo <weizhuo[at]gamil[dot]com> + * @link http://www.pradosoft.com/ + * @copyright Copyright © 2005-2014 PradoSoft + * @license http://www.pradosoft.com/license/ + * @package System.Web.Services + */ + +/** + * TJsonResponse Class + * + * TJsonResponse is the base class for all JSON response provider classes. + * + * Derived classes must implement {@link getJsonContent()} to return + * an object or literals to be converted to JSON format. The response + * will be empty if the returned content is null. + * + * @author Wei Zhuo <weizhuo[at]gmail[dot]com> + * @package System.Web.Services + * @since 3.1 + */ +abstract class TJsonResponse extends TApplicationComponent +{ + private $_id=''; + + /** + * Initializes the feed. + * @param TXmlElement configurations specified in {@link TJsonService}. + */ + public function init($config) + { + } + + /** + * @return string ID of this response + */ + public function getID() + { + return $this->_id; + } + + /** + * @param string ID of this response + */ + public function setID($value) + { + $this->_id=$value; + } + + /** + * @return object json response content, null to suppress output. + */ + abstract public function getJsonContent(); +}
\ No newline at end of file |