Documentation MyBrickStore

Db extends PDO
in package

Class Db

  • Database Connection Wrapper.
  • Implements the Singleton Pattern to ensure a single active database connection per request.
  • Extends PDO to provide direct access to database methods.

Table of Contents

Properties

$instance  : Db|null

Methods

getInstance()  : self
Returns the single instance of the Database connection.
__construct()  : mixed
Private constructor to prevent direct instantiation.

Properties

$instance

private static Db|null $instance

The single instance of the class.

Methods

getInstance()

Returns the single instance of the Database connection.

public static getInstance() : self
Return values
self

__construct()

Private constructor to prevent direct instantiation.

private __construct() : mixed

Establishes the PDO connection using environment variables.


        
On this page

Search results