sEvent = $sEvent; $this->aEventData = $aEventData; $this->mEventSource = $mEventSource; $this->aCallbackData = []; } /** * Get the event fired. * * @api * @return string Event fired. */ public function GetEvent(): string { return $this->sEvent; } /** * Get any parameter from the data sent when firing the event. * * @api * @param $sParam * * @return mixed|null Parameter given when firing the event. */ public function Get($sParam) { if (isset($this->aEventData[$sParam])) { return $this->aEventData[$sParam]; } if (isset($this->aCallbackData[$sParam])) { return $this->aCallbackData[$sParam]; } return null; } /** * Get event source of fired event. * * @api * @return mixed Source given when firing the event. */ public function GetEventSource() { return $this->mEventSource; } /** * Get all the data sent when firing the event. * * @api * @return array All the data given when firing the event. */ public function GetEventData(): array { return $this->aEventData; } /** * @param mixed $aCallbackData */ public function SetCallbackData($aCallbackData) { $this->aCallbackData = $aCallbackData ?? []; } /** * @api * @uses static::$aCallbackData */ public function GetCallbackData(): array { return $this->aCallbackData; } }