Tool.php 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218
  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-2015 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. * @see Zend_Tool_Framework_Metadata_Basic
  24. */
  25. require_once 'Zend/Tool/Framework/Metadata/Basic.php';
  26. /**
  27. * @category Zend
  28. * @package Zend_Tool
  29. * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
  30. * @license http://framework.zend.com/license/new-bsd New BSD License
  31. */
  32. class Zend_Tool_Framework_Metadata_Tool extends Zend_Tool_Framework_Metadata_Basic
  33. {
  34. /**
  35. * @var string
  36. */
  37. protected $_type = 'Tool';
  38. /**#@+
  39. * @var string
  40. */
  41. protected $_clientName = null;
  42. protected $_actionName = null;
  43. protected $_providerName = null;
  44. protected $_specialtyName = null;
  45. /**#@-*/
  46. /**#@+
  47. * @var string
  48. */
  49. protected $_clientReference = null;
  50. protected $_actionReference = null;
  51. protected $_providerReference = null;
  52. /**#@-*/
  53. public function setClientName($clientName)
  54. {
  55. $this->_clientName = $clientName;
  56. return $this;
  57. }
  58. public function getClientName()
  59. {
  60. return $this->_clientName;
  61. }
  62. /**
  63. * setActionName()
  64. *
  65. * @param string $actionName
  66. * @return Zend_Tool_Framework_Metadata_Tool
  67. */
  68. public function setActionName($actionName)
  69. {
  70. $this->_actionName = $actionName;
  71. return $this;
  72. }
  73. /**
  74. * getActionName()
  75. *
  76. * @return string
  77. */
  78. public function getActionName()
  79. {
  80. return $this->_actionName;
  81. }
  82. /**
  83. * setProviderName()
  84. *
  85. * @param string $providerName
  86. * @return Zend_Tool_Framework_Metadata_Tool
  87. */
  88. public function setProviderName($providerName)
  89. {
  90. $this->_providerName = $providerName;
  91. return $this;
  92. }
  93. /**
  94. * getProviderName()
  95. *
  96. * @return string
  97. */
  98. public function getProviderName()
  99. {
  100. return $this->_providerName;
  101. }
  102. /**
  103. * setSpecialtyName()
  104. *
  105. * @param string $specialtyName
  106. * @return Zend_Tool_Framework_Metadata_Tool
  107. */
  108. public function setSpecialtyName($specialtyName)
  109. {
  110. $this->_specialtyName = $specialtyName;
  111. return $this;
  112. }
  113. /**
  114. * getSpecialtyName()
  115. *
  116. * @return string
  117. */
  118. public function getSpecialtyName()
  119. {
  120. return $this->_specialtyName;
  121. }
  122. /**
  123. * setClientReference()
  124. *
  125. * @param Zend_Tool_Framework_Client_Abstract $client
  126. * @return Zend_Tool_Framework_Metadata_Tool
  127. */
  128. public function setClientReference(Zend_Tool_Framework_Client_Abstract $client)
  129. {
  130. $this->_clientReference = $client;
  131. return $this;
  132. }
  133. /**
  134. * getClientReference()
  135. *
  136. * @return Zend_Tool_Framework_Client_Abstract
  137. */
  138. public function getClientReference()
  139. {
  140. return $this->_clientReference;
  141. }
  142. /**
  143. * setActionReference()
  144. *
  145. * @param Zend_Tool_Framework_Action_Interface $action
  146. * @return Zend_Tool_Framework_Metadata_Tool
  147. */
  148. public function setActionReference(Zend_Tool_Framework_Action_Interface $action)
  149. {
  150. $this->_actionReference = $action;
  151. return $this;
  152. }
  153. /**
  154. * getActionReference()
  155. *
  156. * @return Zend_Tool_Framework_Action_Interface
  157. */
  158. public function getActionReference()
  159. {
  160. return $this->_actionReference;
  161. }
  162. /**
  163. * setProviderReference()
  164. *
  165. * @param Zend_Tool_Framework_Provider_Interface $provider
  166. * @return Zend_Tool_Framework_Metadata_Tool
  167. */
  168. public function setProviderReference(Zend_Tool_Framework_Provider_Interface $provider)
  169. {
  170. $this->_providerReference = $provider;
  171. return $this;
  172. }
  173. /**
  174. * getProviderReference()
  175. *
  176. * @return Zend_Tool_Framework_Provider_Interface
  177. */
  178. public function getProviderReference()
  179. {
  180. return $this->_providerReference;
  181. }
  182. /**
  183. * __toString() cast to string
  184. *
  185. * @return string
  186. */
  187. public function __toString()
  188. {
  189. $string = parent::__toString();
  190. $string .= ' (ProviderName: ' . $this->_providerName
  191. . ', ActionName: ' . $this->_actionName
  192. . ', SpecialtyName: ' . $this->_specialtyName
  193. . ')';
  194. return $string;
  195. }
  196. }