PHP Trait Webiny\Component\StdLib\SingletonTrait

Show file Open project: Webiny/Framework

Protected Properties

Property Type Description
$wfInstance

Public Methods

Method Description
deleteInstance ( ) Deletes the current singleton instance.
getInstance ( ) Return the current instance.

Protected Methods

Method Description
init ( ) Override this if you wish to do some stuff once the singleton instance has been created.

Private Methods

Method Description
__clone ( ) Declare it as private.
__construct ( ) The constructor is set to private to prevent creating new instances.
__wakeup ( ) Declare it as private.

Method Details

deleteInstance() final public static method

Deletes the current singleton instance.
final public static deleteInstance ( )

getInstance() final public static method

If instance doesn't exist, a new instance will be created.
final public static getInstance ( )

init() protected method

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

Property Details

$wfInstance protected static property

protected static $wfInstance