public function onResolveSubject(SubjectEvent $event)
    {
        $params = $event->getParameters();

        if (array_key_exists('type', $params)) {
            if ($params['type'] == 'page') {
                $event->setSubject($this->createPageSubject());
                $event->stopPropagation();
            } elseif ($params['type'] == 'global') {
                $event->setSubject($this->createGlobalSubject());
                $event->stopPropagation();
            }
        }
    }