/** * Returns a singleton reference of this class. * * @author Stefan Herndler * @since 1.0.0 * @return WPT_Ajax */ public static function singleton() { // initialize singleton if first call if (!self::$a_obj_Singleton instanceof WBR_Ajax) { self::$a_obj_Singleton = new self(); } // return the singleton of this class return self::$a_obj_Singleton; }
/** * Loads and registers all ajax requests. * * @author Stefan Herndler * @since 1.0.0 */ private function loadAjax() { // require the class which handles all ajax requests require_once dirname(__FILE__) . '/Ajax.php'; // get the singleton once to call the constructor and initialize the class WBR_Ajax::singleton(); }