public static function getInstance() { if (!self::$_instance) { self::$_instance = new self(); } return self::$_instance; }
public static function instance() { if (!isset(self::$_instance)) { self::$_instance = new Connection(); } return self::$_instance; }
public static function getInstance($dataBase) { if (!self::$_instance instanceof self) { self::$_instance = new self($dataBase); } return self::$_instance; }
/** * get instance * * Falls die einzige Instanz noch nicht existiert, erstelle sie * Gebe die einzige Instanz dann zurück * * @return Singleton */ public static function getInstance() { if (null === self::$_instance) { self::$_instance = new self(); } return self::$_connection; }
public static function getInstance($type) { if (!self::$_instance) { // If no instance then make one self::$_instance = new self(self::$db_host, self::$db_user, self::$db_pass, self::$database); } return self::$_instance; }
public static function getConnexion() { if (!isset(self::$_instance)) { //if ther's no active connexions try { self::$_instance = new PDO(SQL_DSN, SQL_USERNAME, SQL_PASSWORD); //echo self::$_syntaxe ; } catch (PDOException $e) { echo $e; } } return self::$_instance; /* Connexion return */ }
public function __construct() { self::$_instance = $this->realConnect(); }