EventDescription.php 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  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_EventManager
  17. * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
  18. * @license http://framework.zend.com/license/new-bsd New BSD License
  19. */
  20. /**
  21. * Representation of an event
  22. *
  23. * @category Zend
  24. * @package Zend_EventManager
  25. * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
  26. * @license http://framework.zend.com/license/new-bsd New BSD License
  27. */
  28. interface Zend_EventManager_EventDescription
  29. {
  30. /**
  31. * Get event name
  32. *
  33. * @return string
  34. */
  35. public function getName();
  36. /**
  37. * Get target/context from which event was triggered
  38. *
  39. * @return null|string|object
  40. */
  41. public function getTarget();
  42. /**
  43. * Get parameters passed to the event
  44. *
  45. * @return array|ArrayAccess
  46. */
  47. public function getParams();
  48. /**
  49. * Get a single parameter by name
  50. *
  51. * @param string $name
  52. * @param mixed $default Default value to return if parameter does not exist
  53. * @return mixed
  54. */
  55. public function getParam($name, $default = null);
  56. /**
  57. * Set the event name
  58. *
  59. * @param string $name
  60. * @return void
  61. */
  62. public function setName($name);
  63. /**
  64. * Set the event target/context
  65. *
  66. * @param null|string|object $target
  67. * @return void
  68. */
  69. public function setTarget($target);
  70. /**
  71. * Set event parameters
  72. *
  73. * @param string $params
  74. * @return void
  75. */
  76. public function setParams($params);
  77. /**
  78. * Set a single parameter by key
  79. *
  80. * @param string $name
  81. * @param mixed $value
  82. * @return void
  83. */
  84. public function setParam($name, $value);
  85. /**
  86. * Indicate whether or not the parent EventCollection should stop propagating events
  87. *
  88. * @param bool $flag
  89. * @return void
  90. */
  91. public function stopPropagation($flag = true);
  92. /**
  93. * Has this event indicated event propagation should stop?
  94. *
  95. * @return bool
  96. */
  97. public function propagationIsStopped();
  98. }