public static function exists($class, $name)
    {
        $class = ObjectHelper::getClass($class);
        do {
            if (!empty(self::$events[$class][$name])) {
                return true;
            }
        } while (($class = get_parent_class($class)) !== false);

        return false;
    }