\app\framework\Component\StdLibSingletonTrait

SingletonTrait is a helper, once implemented on a class, automatically adds the singleton pattern to that class.

Summary

Methods
Properties
Constants
getInstance()
deleteInstance()
No public properties found
No constants found
init()
$wfInstance
N/A
__construct()
__wakeup()
__clone()
No private properties found
N/A

Properties

$wfInstance

$wfInstance : 

Type

Methods

getInstance()

getInstance() : $this

Return the current instance.

If instance doesn't exist, a new instance will be created.

Returns

$this

deleteInstance()

deleteInstance() 

Deletes the current singleton instance.

init()

init() 

Override this if you wish to do some stuff once the singleton instance has been created.

__construct()

__construct() 

The constructor is set to private to prevent creating new instances.

If you want to fire a function after the singleton instance is created, just implement 'init' method into your class.

__wakeup()

__wakeup() 

Declare it as private.

__clone()

__clone() 

Declare it as private.