protected function trigger($name, array $params)
    {
        $event = clone $this->getEvent();
        $event->setName($name);
        $event->setParams($params);

        $responseCollection = $this->getEventManager()->triggerEvent($event);

        if ($responseCollection->stopped() && $event->isError()) {
            throw new RuntimeException($event->getError(), $event->getErrorNr());
        }

        return $event->getResult();
    }