public function triggerEvent($apiVersion, $eventName, array $params = array())
    {
        if (!isset($this->plugins[$apiVersion])) {
            return;
        }

        // API v0
        if ($apiVersion === self::API_VERSION_0_9) {
            // API v0 events are also triggered on plugins using API v1 (but not later)
            $plugins = $this->plugins[self::API_VERSION_0_9];
            if (isset($this->plugins[self::API_VERSION_1_0])) {
                $plugins = array_merge($plugins, $this->plugins[self::API_VERSION_1_0]);
            }

            foreach ($plugins as $plugin) {
                if (method_exists($plugin, $eventName)) {
                    call_user_func_array(array($plugin, $eventName), $params);
                }
            }

            return;
        }

        // API v1 and later
        foreach ($this->plugins[$apiVersion] as $plugin) {
            $plugin->handleEvent($eventName, $params);
        }
    }