MessageBody.php 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. <?php
  2. /**
  3. * AMFBody is a data type that encapsulates all of the various properties a body object can have.
  4. *
  5. * @license http://opensource.org/licenses/gpl-license.php GNU Public License
  6. * @copyright (c) 2003 amfphp.org
  7. * @package flashservices
  8. * @subpackage util
  9. * @version $Id: AMFBody.php,v 1.6 2005/07/05 07:40:53 pmineault Exp $
  10. */
  11. class MessageBody {
  12. var $targetURI = "";
  13. var $responseURI = "";
  14. var $uriClassPath = "";
  15. var $classPath = "";
  16. var $className = "";
  17. var $methodName = "";
  18. var $responseTarget = "null";
  19. var $noExec = false;
  20. var $_value = NULL;
  21. var $_results = NULL;
  22. var $_classConstruct = NULL;
  23. var $_specialHandling = NULL;
  24. var $_metaData = array();
  25. /**
  26. * AMFBody is the Contstructor method for the class
  27. */
  28. function MessageBody ($targetURI = "", $responseIndex = "", $value = "") {
  29. $GLOBALS['amfphp']['lastMethodCall'] = $responseIndex;
  30. $this->responseIndex = $responseIndex;
  31. $this->targetURI = $targetURI;
  32. $this->responseURI = $this->responseIndex . "/onStatus"; // default to the onstatus method
  33. $this->setValue($value);
  34. }
  35. /**
  36. * setter for the results from the process execution
  37. *
  38. * @param mixed $results The returned results from the process execution
  39. */
  40. function setResults ($result) {
  41. $this->_results = $result;
  42. }
  43. /**
  44. * getter for the result of the process execution
  45. *
  46. * @return mixed The results
  47. */
  48. function &getResults () {
  49. return $this->_results;
  50. }
  51. /**
  52. * setter for the class construct
  53. *
  54. * @param object $classConstruct The instance of the service class
  55. */
  56. function setClassConstruct (&$classConstruct) {
  57. $this->_classConstruct = &$classConstruct;
  58. }
  59. /**
  60. * getter for the class construct
  61. *
  62. * @return object The class instance
  63. */
  64. function &getClassConstruct () {
  65. return $this->_classConstruct;
  66. }
  67. /**
  68. * setter for the value property
  69. *
  70. * @param mixed $value The value of the body object
  71. */
  72. function setValue ($value) {
  73. $this->_value = $value;
  74. }
  75. /**
  76. * getter for the value property
  77. *
  78. * @return mixed The value property
  79. */
  80. function &getValue () {
  81. return $this->_value;
  82. }
  83. /**
  84. * Set special handling type for this body
  85. */
  86. function setSpecialHandling($type)
  87. {
  88. $this->_specialHandling = $type;
  89. }
  90. /**
  91. * Get special handling type for this body
  92. */
  93. function getSpecialHandling()
  94. {
  95. return $this->_specialHandling;
  96. }
  97. /**
  98. * Check if this body is handled special against an array of special cases
  99. */
  100. function isSpecialHandling($against = NULL)
  101. {
  102. if($against !== NULL)
  103. {
  104. return in_array($this->_specialHandling, $against);
  105. }
  106. else
  107. {
  108. return ($this->_specialHandling != NULL);
  109. }
  110. }
  111. function setMetaData($key, $val)
  112. {
  113. $this->_metaData[$key] = $val;
  114. }
  115. function getMetaData($key)
  116. {
  117. if(isset($this->_metaData[$key]))
  118. {
  119. return $this->_metaData[$key];
  120. }
  121. else
  122. {
  123. return NULL;
  124. }
  125. }
  126. }
  127. ?>