Documentation

Singleton

Singleton trait.

Allows a simple interface for treating a class as a singleton. Usage: myObject::instance()

Tags
author

Alexey Bobkov, Samuel Georges

Table of Contents

$instance  : mixed
__clone()  : mixed
__wakeup()  : mixed
forgetInstance()  : mixed
Forget this singleton's instance if it exists
instance()  : mixed
Create a new instance of this singleton.
__construct()  : mixed
Constructor.
init()  : mixed
Initialize the singleton free from constructor parameters.

Properties

Methods

__clone()

public __clone() : mixed
Return values
mixed

__wakeup()

public __wakeup() : mixed
Return values
mixed

forgetInstance()

Forget this singleton's instance if it exists

public final static forgetInstance() : mixed
Return values
mixed

instance()

Create a new instance of this singleton.

public final static instance() : mixed
Return values
mixed

__construct()

Constructor.

protected final __construct() : mixed
Return values
mixed

init()

Initialize the singleton free from constructor parameters.

protected init() : mixed
Return values
mixed

Search results