DB::getInstance (method)

Last updated: Tue, Oct 31, 2023 1:43 pm
Return to Knowledgebase

Purpose

Creates a single instance of the DB class

Location

users/classes/DB.php

Parameters

This function does not take any arguments

Example

$database = DB::getInstance();

Further Documentation:

1. It checks if the instance of the DB class, stored in the $_instance variable, has already been created. If it hasn't been created, it initializes a new instance of the DB class and assigns it to the $_instance variable.
2. It returns the created or existing instance of the DB class.