|
|
@@ -125,6 +125,7 @@ class Event
|
|
|
* Returns the name of this event. This is usually used as the event identifier
|
|
|
*
|
|
|
* @return string
|
|
|
+ * @deprecated 3.4.0 use getName() instead.
|
|
|
*/
|
|
|
public function name()
|
|
|
{
|
|
|
@@ -132,9 +133,20 @@ class Event
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
+ * Returns the name of this event. This is usually used as the event identifier
|
|
|
+ *
|
|
|
+ * @return string
|
|
|
+ */
|
|
|
+ public function getName()
|
|
|
+ {
|
|
|
+ return $this->_name;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
* Returns the subject of this event
|
|
|
*
|
|
|
* @return object
|
|
|
+ * @deprecated 3.4.0 use getSubject() instead.
|
|
|
*/
|
|
|
public function subject()
|
|
|
{
|
|
|
@@ -142,6 +154,16 @@ class Event
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
+ * Returns the subject of this event
|
|
|
+ *
|
|
|
+ * @return object
|
|
|
+ */
|
|
|
+ public function getSubject()
|
|
|
+ {
|
|
|
+ return $this->_subject;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
* Stops the event from being used anymore
|
|
|
*
|
|
|
* @return void
|
|
|
@@ -165,6 +187,7 @@ class Event
|
|
|
* The result value of the event listeners
|
|
|
*
|
|
|
* @return mixed
|
|
|
+ * @deprecated 3.4.0 use getResult() instead.
|
|
|
*/
|
|
|
public function result()
|
|
|
{
|
|
|
@@ -172,6 +195,16 @@ class Event
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
+ * The result value of the event listeners
|
|
|
+ *
|
|
|
+ * @return mixed
|
|
|
+ */
|
|
|
+ public function getResult()
|
|
|
+ {
|
|
|
+ return $this->_result;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
* Listeners can attach a result value to the event.
|
|
|
*
|
|
|
* @param mixed $value The value to set.
|
|
|
@@ -190,9 +223,22 @@ class Event
|
|
|
* @param string|null $key The data payload element to return, or null to return all data.
|
|
|
* @return array|mixed|null The data payload if $key is null, or the data value for the given $key. If the $key does not
|
|
|
* exist a null value is returned.
|
|
|
+ * @deprecated 3.4.0 use getData() instead.
|
|
|
*/
|
|
|
public function data($key = null)
|
|
|
{
|
|
|
+ return $this->getData($key);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Access the event data/payload.
|
|
|
+ *
|
|
|
+ * @param string|null $key The data payload element to return, or null to return all data.
|
|
|
+ * @return array|mixed|null The data payload if $key is null, or the data value for the given $key. If the $key does not
|
|
|
+ * exist a null value is returned.
|
|
|
+ */
|
|
|
+ public function getData($key = null)
|
|
|
+ {
|
|
|
if ($key !== null) {
|
|
|
return isset($this->_data[$key]) ? $this->_data[$key] : null;
|
|
|
}
|