\phpWTLaSingleton

Abstract class as a basis for Singleton.

Summary

Methods
Properties
Constants
getInstance()
No public properties found
No constants found
__clone()
__sleep()
__wakeup()
__construct()
$_instance
N/A
No private methods found
No private properties found
N/A

Properties

$_instance

$_instance : 

Array to hold instances of all derived classes.

Type

Methods

getInstance()

getInstance(array|mixed|null  $inject = null) : \phpWTL\$_instance[$class]

Create new instance or give back already existing one.

Parameters

array|mixed|null $inject

Can be used to inject one or more parameter(s) into the constructor

Returns

\phpWTL\$_instance[$class] —

The instance of a derived class

__clone()

__clone() 

Disable cloning for singleton.

Throws

\phpWTL\Exception

if called

__sleep()

__sleep() 

Disable serialization for singleton.

Throws

\phpWTL\Exception

if called

__wakeup()

__wakeup() 

Disable de-serialization for singleton.

Throws

\phpWTL\Exception

if called

__construct()

__construct(object|null  $inject = null) 

Constructor stump.

Parameters

object|null $inject

Can be used to inject one or more parameter(s) into the constructor.