protected function getEventsById($id)
    {
        $events = [];
        $methods = get_class_methods($this->getPluginClass($id));
        foreach ($methods as $method) {
            // The event naming is onName[Priority],eg onProductShowItem50
            if (substr($method, 0, 2) != 'on') {
                continue;
            }
            $event = lcfirst(substr($method, 2));
            if (is_numeric(substr($event, -1))) {
                preg_match('/(.+?)(\d+)$/', $event, $matches);
                $events[] = ['name' => $matches[1], 'priority' => (int) $matches[2]];
            } else {
                $events[] = ['name' => $event, 'priority' => static::DEFAULT_PRIORITY];
            }
        }

        return $events;
    }