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;
    }
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;
    }
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 ; }
Returns the event definitions by plugin ID

@param string $id
@return array
Returns the event definitions by plugin ID