/** * Este es el pseudo constructor singleton * Comprueba si la variable privada $_oSelf tiene un objeto * de esta misma clase, si no lo tiene lo crea y lo guarda * @static * @return resource */ public static function getInstancia() { if (!isset(self::$_oSelf)) { $instancia = new self(); //new self ejecuta __construct() self::$_oSelf = $instancia; $this->_oLinkId = $instancia->conectar(); } $conex = self::$_oSelf; return $conex->_oLinkId; //Se devuelve el link a la conexion }