3 * Zend Framework (http://framework.zend.com/)
5 * @link http://github.com/zendframework/zf2 for the canonical source repository
6 * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
7 * @license http://framework.zend.com/license/new-bsd New BSD License
10 namespace Zend\Db\TableGateway\Feature\EventFeature
;
12 use Zend\Db\TableGateway\AbstractTableGateway
;
13 use Zend\EventManager\EventInterface
;
15 class TableGatewayEvent
implements EventInterface
19 * @var AbstractTableGateway
21 protected $target = null;
26 protected $name = null;
29 * @var array|\ArrayAccess
31 protected $params = array();
38 public function getName()
44 * Get target/context from which event was triggered
46 * @return null|string|object
48 public function getTarget()
54 * Get parameters passed to the event
56 * @return array|\ArrayAccess
58 public function getParams()
64 * Get a single parameter by name
67 * @param mixed $default Default value to return if parameter does not exist
70 public function getParam($name, $default = null)
72 return (isset($this->params
[$name]) ?
$this->params
[$name] : $default);
81 public function setName($name)
87 * Set the event target/context
89 * @param null|string|object $target
92 public function setTarget($target)
94 $this->target
= $target;
98 * Set event parameters
100 * @param string $params
103 public function setParams($params)
105 $this->params
= $params;
109 * Set a single parameter by key
111 * @param string $name
112 * @param mixed $value
115 public function setParam($name, $value)
117 $this->params
[$name] = $value;
121 * Indicate whether or not the parent EventManagerInterface should stop propagating events
126 public function stopPropagation($flag = true)
132 * Has this event indicated event propagation should stop?
136 public function propagationIsStopped()