public static function methodExists($object, $method_name, $only_events = false) {
        if (!$only_events && method_exists($object, $method_name)) {
            return true;
        } else {
            // Check to see if there is an event bound to the method.
            $event_name = self::getEventname([$object, $method_name]);
            return static::hasHandler($event_name);
        }
    }