Documentation

Singleton

AbstractYes

Singleton

This abstract class represents the Singleton design pattern. It ensures that only one instance of a class is created and provides a global access point to that instance.

Table of Contents

Properties

$instance  : static
The singleton instance.

Methods

Create()  : static
Creates an instance of the singleton class if it does not already exist, and returns the instance.

Properties

$instance

The singleton instance.

public static static $instance

Methods

Create()

Creates an instance of the singleton class if it does not already exist, and returns the instance.

public static Create(mixed ...$arguments) : static
Parameters
$arguments : mixed

Arguments to be passed to the constructor, if needed.

Return values
static

The singleton instance.


        
On this page

Search results