Event?

@param string $name
@param string $payload
181320
public function event($name, $payload = null) {
		$this->log->log("EVENT: $name",  Net_XMPP_XMPPHP_Log::LEVEL_DEBUG);
		foreach($this->eventhandlers as $handler) {
			if($name == $handler[0]) {
				if($handler[2] === null) {
					$handler[2] = $this;
				}
				$handler[2]->$handler[1]($payload);
			}
		}
		foreach($this->until as $key => $until) {
			if(is_array($until)) {
				if(in_array($name, $until)) {
					$this->until_payload[$key][] = array($name, $payload);
					if(!isset($this->until_count[$key])) {
						$this->until_count[$key] = 0;
					}
					$this->until_count[$key] += 1;
					#$this->until[$key] = false;
				}
			}
		}
	}
1059688
public function triggerEvent($event, Payload $payload)
    {
        if ($payload->state() === null) {
            $this->updatePayload($this->process->initialState(), $payload);
        }

        $state = $this->process->state($payload->state());

        $nextStateName = $state->triggerEvent($event, $payload);
        if ($nextStateName === null) {
            return;
        }

        $state = $this->process->state($nextStateName);

        $this->updatePayload($state, $payload);
        $this->handleOnStateWasSet($state, $payload);
    }
1224507
public function fireOnceIfNamed($event, $payload=[], $halt=false)
    {
        if(!$event){
            return;
        }
        return $this->fireOnce($event, $payload, $halt);
    }
638236
public function handle($event, $payload)
    {
        list($model) = $payload;
        
        // Check for matching input elements
        foreach (Request::input() as $key => $val) {
            if (preg_match('#^'.self::PREFIX.'(.+)#', $key, $matches)) {
                $this->updateRelationship($model, $matches[1]);
            }
        }
    }
1198439
final protected function applyChange(Serializable $payload)
    {
        $this->apply($payload);
        $this->changes()->addEventFromPayload($payload);
    }
691980
public function event($topicUri, $payload)
    {
        $type = Protocol::MSG_EVENT;
        $data = array($type, $topicUri, $payload);
        $this->send($data);
    }
266180
public static function createPostbackEvent(array $payload)
    {
        $postback = Postback::create($payload['postback']);
        $senderId = $payload['sender']['id'];
        $recipientId = $payload['recipient']['id'];
        $timestamp = $payload['timestamp'];

        return new PostbackEvent($senderId, $recipientId, $timestamp, $postback);
    }
1234278
public static function on($name, $callback, $priority = 0)
    {
        if (is_string($name) && is_callable($callback)) {
            if (isset(self::$events[$name]) === false) {
                self::$events[$name] = array();
            }

            self::$events[$name][] = array($callback, $priority);
        }
    }
1002317
protected function fireFinalEvent($name = null, $resource = null)
    {
        if (empty($name)) {
            $name = $this->getEventName();
        }
        if (empty($resource)) {
            $resource = $this->getEventResource();
        }
        /** @noinspection PhpUnusedLocalVariableInspection */
        $results = \Event::fire(new ApiEvent($name, $this->request, $this->response, $resource));
    }
1010915
public function on($name, $handler, $data=array(), $append=true)
	{
		$this->ensureEvents();
		
		if ($append || empty($this->_events[$name])) {
		    $this->_events[$name][] = $data ? [$handler, $data] : [$handler];
		} else {
		    array_unshift($this->_events[$name], $data ? [$handler, $data] : [$handler]);
		}
	}
672643
private function fireEvent($event, $payload = [], $halt = false)
    {
        return $this->getEventDispatcher()->fire($event, $payload, $halt);
    }
386159
private function performPostRequest($payload)
	{
	    $payload[] = ['type' => $this->apiXType, 'routing' => $this->apiXRoute, 'token' => $this->apiXToken];
		$this->response = $this->client->request('POST', [
            'query' => $payload
        ]);
	}
309302
public function triggerSubEvent($name, $event, $args = [])
    {
        return $this->getDispatcher($name)->triggerEvent($event, $args);
    }
868125
public function push($event, $payload = array())
	{
		$this->listen($event.'_pushed', function() use ($event, $payload)
		{
			$this->fire($event, $payload);
		});
	}
328750
public function triggerEvent($name, Event $event = null)
    {
        return $this->e->trigger($name, $event);
    }
1348037
public function trigger($name, Event $event = null)
    {
        if (! isset($event)) {
            $event = new Event($this->subject);
        }
        if (isset($this->parent)) {
            if (! $this->parent->trigger($this->subjectClass . '.' . $name, $event)) {
                return false;
            }
        }
        if (isset($this->events[$name])) {
            $event->name = $name;
            foreach ($this->events[$name] as $function) {
                $continue = call_user_func($function, $event);
                if ($event->stopped or $continue === false) {
                    return false;
                }
            }
        } elseif (strpos($name, '.') === false) {
            throw new InvalidEventException(
                'Event subject "' . $this->subjectClass
                . '" does not have event "' . $name . '"'
            );
        }
        return true;
    }
174018
public function broadcast(array $channels, $event, array $payload = [])
    {
        $this->pushman->push($event, $channels, $payload);
    }