public static function attachClassListeners($class)
    {
        $methods = get_class_methods($class);
        foreach ($methods as $method) {
            if (preg_match('/^on[A-Z].*$/', $method)) {
                $event = preg_replace('/(?<=\\w)([A-Z])/', '::\1', substr($method, 2));
                self::listenEvent($event, array($class, $method));
            }
        }
    }
public static function attachClassListeners($class)
    {
        $methods = get_class_methods($class);
        foreach ($methods as $method) {
            if (preg_match('/^on[A-Z].*$/', $method)) {
                $event = preg_replace('/(?<=\\w)([A-Z])/', '::\1', substr($method, 2));
                self::listenEvent($event, array($class, $method));
            }
        }
    }
public static function attachClassListeners ( $ class ) { $ methods = get_class_methods ( $ class ) ; foreach ( $ methods as $ method ) { if ( preg_match ( '/^on[A-Z].*$/' , $ method ) ) { $ event = preg_replace ( '/(?<=\\w)([A-Z])/' , '::\1' , substr ( $ method , 2 ) ) ; self :: listenEvent ( $ event , array ( $ class , $ method ) ) ; } } }
Automatically registers event listeners for methods starting with "on"

@param string|object $class
Automatically registers event listeners for methods starting with on