public static function getInstance($connect = true) {
        if (!isset(self::$instances[static::class])) {
            self::$instances[static::class] = new static();
        }
        /** @var DB $instance */
        $instance = self::$instances[static::class];
        if ($connect) {
            $instance->connect();
        }
        return $instance;
    }
public static function getInstance($connect = true) {
        if (!isset(self::$instances[static::class])) {
            self::$instances[static::class] = new static();
        }
        /** @var DB $instance */
        $instance = self::$instances[static::class];
        if ($connect) {
            $instance->connect();
        }
        return $instance;
    }
public static function getInstance ( $ connect = true ) { if ( ! isset ( self :: $ instances [ static :: class ] ) ) { self :: $ instances [ static :: class ] = new static ( ) ; } /** @var DB $instance */ $ instance = self :: $ instances [ static :: class ] ; if ( $ connect ) { $ instance -> connect ( ) ; } return $ instance ; }
Gets the singleton instance of the DB. Used throughout the framework.
@return static Returns the singlton DB object.
Gets the singleton instance of the DB . Used throughout the framework .