Request.php 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299
  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 license@zend.com so we can send you a copy immediately.
  14. *
  15. * @category Zend
  16. * @package Zend_Tool
  17. * @subpackage Framework
  18. * @copyright Copyright (c) 2005-2014 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. * @category Zend
  24. * @package Zend_Tool
  25. * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
  26. * @license http://framework.zend.com/license/new-bsd New BSD License
  27. */
  28. class Zend_Tool_Framework_Client_Request
  29. {
  30. /**
  31. * @var string
  32. */
  33. protected $_providerName = null;
  34. /**
  35. * @var string
  36. */
  37. protected $_specialtyName = null;
  38. /**
  39. * @var string
  40. */
  41. protected $_actionName = null;
  42. /**
  43. * @var array
  44. */
  45. protected $_actionParameters = array();
  46. /**
  47. * @var array
  48. */
  49. protected $_providerParameters = array();
  50. /**
  51. * @var bool
  52. */
  53. protected $_isPretend = false;
  54. /**
  55. * @var bool
  56. */
  57. protected $_isDebug = false;
  58. /**
  59. * @var bool
  60. */
  61. protected $_isVerbose = false;
  62. /**
  63. * @var bool
  64. */
  65. protected $_isDispatchable = true;
  66. /**
  67. * setProviderName()
  68. *
  69. * @param string $providerName
  70. * @return Zend_Tool_Framework_Client_Request
  71. */
  72. public function setProviderName($providerName)
  73. {
  74. $this->_providerName = $providerName;
  75. return $this;
  76. }
  77. /**
  78. * getProviderName()
  79. *
  80. * @return string
  81. */
  82. public function getProviderName()
  83. {
  84. return $this->_providerName;
  85. }
  86. /**
  87. * setSpecialtyName()
  88. *
  89. * @param string $specialtyName
  90. * @return Zend_Tool_Framework_Client_Request
  91. */
  92. public function setSpecialtyName($specialtyName)
  93. {
  94. $this->_specialtyName = $specialtyName;
  95. return $this;
  96. }
  97. /**
  98. * getSpecialtyName()
  99. *
  100. * @return string
  101. */
  102. public function getSpecialtyName()
  103. {
  104. return $this->_specialtyName;
  105. }
  106. /**
  107. * setActionName()
  108. *
  109. * @param string $actionName
  110. * @return Zend_Tool_Framework_Client_Request
  111. */
  112. public function setActionName($actionName)
  113. {
  114. $this->_actionName = $actionName;
  115. return $this;
  116. }
  117. /**
  118. * getActionName()
  119. *
  120. * @return string
  121. */
  122. public function getActionName()
  123. {
  124. return $this->_actionName;
  125. }
  126. /**
  127. * setActionParameter()
  128. *
  129. * @param string $parameterName
  130. * @param string $parameterValue
  131. * @return Zend_Tool_Framework_Client_Request
  132. */
  133. public function setActionParameter($parameterName, $parameterValue)
  134. {
  135. $this->_actionParameters[$parameterName] = $parameterValue;
  136. return $this;
  137. }
  138. /**
  139. * getActionParameters()
  140. *
  141. * @return array
  142. */
  143. public function getActionParameters()
  144. {
  145. return $this->_actionParameters;
  146. }
  147. /**
  148. * getActionParameter()
  149. *
  150. * @param string $parameterName
  151. * @return string
  152. */
  153. public function getActionParameter($parameterName)
  154. {
  155. return (isset($this->_actionParameters[$parameterName])) ? $this->_actionParameters[$parameterName] : null;
  156. }
  157. /**
  158. * setProviderParameter()
  159. *
  160. * @param string $parameterName
  161. * @param string $parameterValue
  162. * @return Zend_Tool_Framework_Client_Request
  163. */
  164. public function setProviderParameter($parameterName, $parameterValue)
  165. {
  166. $this->_providerParameters[$parameterName] = $parameterValue;
  167. return $this;
  168. }
  169. /**
  170. * getProviderParameters()
  171. *
  172. * @return array
  173. */
  174. public function getProviderParameters()
  175. {
  176. return $this->_providerParameters;
  177. }
  178. /**
  179. * getProviderParameter()
  180. *
  181. * @param string $parameterName
  182. * @return string
  183. */
  184. public function getProviderParameter($parameterName)
  185. {
  186. return (isset($this->_providerParameters[$parameterName])) ? $this->_providerParameters[$parameterName] : null;
  187. }
  188. /**
  189. * setPretend()
  190. *
  191. * @param bool $pretend
  192. * @return Zend_Tool_Framework_Client_Request
  193. */
  194. public function setPretend($pretend)
  195. {
  196. $this->_isPretend = (bool) $pretend;
  197. return $this;
  198. }
  199. /**
  200. * isPretend() - Whether or not this is a pretend request
  201. *
  202. * @return bool
  203. */
  204. public function isPretend()
  205. {
  206. return $this->_isPretend;
  207. }
  208. /**
  209. * setDebug()
  210. *
  211. * @param bool $pretend
  212. * @return Zend_Tool_Framework_Client_Request
  213. */
  214. public function setDebug($debug)
  215. {
  216. $this->_isDebug = (bool) $debug;
  217. return $this;
  218. }
  219. /**
  220. * isDebug() - Whether or not this is a debug enabled request
  221. *
  222. * @return bool
  223. */
  224. public function isDebug()
  225. {
  226. return $this->_isDebug;
  227. }
  228. /**
  229. * setVerbose()
  230. *
  231. * @param bool $verbose
  232. * @return Zend_Tool_Framework_Client_Request
  233. */
  234. public function setVerbose($verbose)
  235. {
  236. $this->_isVerbose = (bool) $verbose;
  237. return $this;
  238. }
  239. /**
  240. * isVerbose() - Whether or not this is a verbose enabled request
  241. *
  242. * @return bool
  243. */
  244. public function isVerbose()
  245. {
  246. return $this->_isVerbose;
  247. }
  248. /**
  249. * setDispatchable()
  250. *
  251. * @param bool $dispatchable
  252. * @return Zend_Tool_Framework_Client_Request
  253. */
  254. public function setDispatchable($dispatchable)
  255. {
  256. $this->_isDispatchable = (bool) $dispatchable;
  257. return $this;
  258. }
  259. /**
  260. * isDispatchable() Is this request Dispatchable?
  261. *
  262. * @return bool
  263. */
  264. public function isDispatchable()
  265. {
  266. return $this->_isDispatchable;
  267. }
  268. }