Example #1
0
 protected function eventDistributer()
 {
     $event = strtolower($this->request->getEvent());
     $msgType = strtolower($this->request->getMsgType());
     if ($msgType === 'event') {
         if ($event === Event::EVENT_SUBSCRIBE) {
             if ($this->request->getArrayContent('EventKey')) {
                 $this->dispatcher->dispatch(Event::EVENT_QRCODE_SUBSCRIBE, new ResponseEvent($this->response, $this->request));
                 return;
             }
         }
         if ($event === Event::EVENT_CLICK) {
             if ($this->request->getArrayContent('EventKey')) {
                 $this->dispatcher->dispatch(strtoupper($this->request->getArrayContent('EventKey')), new ResponseEvent($this->response, $this->request));
                 return;
             }
         }
         $this->dispatcher->dispatch($event, new ResponseEvent($this->response, $this->request));
     } else {
         $this->dispatcher->dispatch($msgType, new ResponseEvent($this->response, $this->request));
     }
 }