[ Index ] |
PHP Cross Reference of moodle-2.8 |
[Summary view] [Print] [Text view]
1 <?php 2 /** 3 * Zend Framework 4 * 5 * LICENSE 6 * 7 * This source file is subject to the new BSD license that is bundled 8 * with this package in the file LICENSE.txt. 9 * It is also available through the world-wide-web at this URL: 10 * http://framework.zend.com/license/new-bsd 11 * If you did not receive a copy of the license and are unable to 12 * obtain it through the world-wide-web, please send an email 13 * to [email protected] so we can send you a copy immediately. 14 * 15 * @category Zend 16 * @package Zend_Amf 17 * @subpackage Value 18 * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) 19 * @license http://framework.zend.com/license/new-bsd New BSD License 20 * @version $Id$ 21 */ 22 23 /** 24 * An AMF Message contains information about the actual individual 25 * transaction that is to be performed. It specifies the remote 26 * operation that is to be performed; a local (client) operation 27 * to be invoked upon success; and, the data to be used in the 28 * operation. 29 * <p/> 30 * This Message structure defines how a local client would 31 * invoke a method/operation on a remote server. Additionally, 32 * the response from the Server is structured identically. 33 * 34 * @package Zend_Amf 35 * @subpackage Value 36 * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) 37 * @license http://framework.zend.com/license/new-bsd New BSD License 38 */ 39 class Zend_Amf_Value_MessageBody 40 { 41 /** 42 * A string describing which operation, function, or method 43 * is to be remotley invoked. 44 * @var string 45 */ 46 protected $_targetUri = ""; 47 48 /** 49 * Universal Resource Identifier that uniquely targets the originator's 50 * Object that should receive the server's response. The server will 51 * use this path specification to target the "OnResult()" or "onStatus()" 52 * handlers within the client. For Flash, it specifies an ActionScript 53 * Object path only. The NetResponse object pointed to by the Response Uri 54 * contains the connection state information. Passing/specifying this 55 * provides a convenient mechanism for the client/server to share access 56 * to an object that is managing the state of the shared connection. 57 * 58 * Since the server will use this field in the event of an error, 59 * this field is required even if a successful server request would 60 * not be expected to return a value to the client. 61 * 62 * @var string 63 */ 64 protected $_responseUri = ""; 65 66 /** 67 * Contains the actual data associated with the operation. It contains 68 * the client's parameter data that is passed to the server's operation/method. 69 * When serializing a root level data type or a parameter list array, no 70 * name field is included. That is, the data is anonomously represented 71 * as "Type Marker"/"Value" pairs. When serializing member data, the data is 72 * represented as a series of "Name"/"Type"/"Value" combinations. 73 * 74 * For server generated responses, it may contain any ActionScript 75 * data/objects that the server was expected to provide. 76 * 77 * @var string 78 */ 79 protected $_data; 80 81 /** 82 * Constructor 83 * 84 * @param string $targetUri 85 * @param string $responseUri 86 * @param string $data 87 * @return void 88 */ 89 public function __construct($targetUri, $responseUri, $data) 90 { 91 $this->setTargetUri($targetUri); 92 $this->setResponseUri($responseUri); 93 $this->setData($data); 94 } 95 96 /** 97 * Retrieve target Uri 98 * 99 * @return string 100 */ 101 public function getTargetUri() 102 { 103 return $this->_targetUri; 104 } 105 106 /** 107 * Set target Uri 108 * 109 * @param string $targetUri 110 * @return Zend_Amf_Value_MessageBody 111 */ 112 public function setTargetUri($targetUri) 113 { 114 if (null === $targetUri) { 115 $targetUri = ''; 116 } 117 $this->_targetUri = (string) $targetUri; 118 return $this; 119 } 120 121 /** 122 * Get target Uri 123 * 124 * @return string 125 */ 126 public function getResponseUri() 127 { 128 return $this->_responseUri; 129 } 130 131 /** 132 * Set response Uri 133 * 134 * @param string $responseUri 135 * @return Zend_Amf_Value_MessageBody 136 */ 137 public function setResponseUri($responseUri) 138 { 139 if (null === $responseUri) { 140 $responseUri = ''; 141 } 142 $this->_responseUri = $responseUri; 143 return $this; 144 } 145 146 /** 147 * Retrieve response data 148 * 149 * @return string 150 */ 151 public function getData() 152 { 153 return $this->_data; 154 } 155 156 /** 157 * Set response data 158 * 159 * @param mixed $data 160 * @return Zend_Amf_Value_MessageBody 161 */ 162 public function setData($data) 163 { 164 $this->_data = $data; 165 return $this; 166 } 167 168 /** 169 * Set reply method 170 * 171 * @param string $methodName 172 * @return Zend_Amf_Value_MessageBody 173 */ 174 public function setReplyMethod($methodName) 175 { 176 if (!preg_match('#^[/?]#', $methodName)) { 177 $this->_targetUri = rtrim($this->_targetUri, '/') . '/'; 178 } 179 $this->_targetUri = $this->_targetUri . $methodName; 180 return $this; 181 } 182 }
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Fri Nov 28 20:29:05 2014 | Cross-referenced by PHPXref 0.7.1 |