PHP Class Habari\Singleton

Singleton base class for subclassing generic singleton pattern classes
Show file Open project: habari/system

Protected Methods

Method Description
__construct ( ) Prevent instance construction and cloning (copying of object instance)
getInstanceOf ( $class ) * The overridden methods can't have a different signature, so there needs to be two functions: one, internal to a class, that calls this one (a singleton factory) that produces objects of the requested classes
instance ( ) : object Declarations that extend this method must have the same signature (arguments and returned types) to pass E_STRICT

Private Methods

Method Description
__clone ( )

Method Details

__construct() final protected method

Prevent instance construction and cloning (copying of object instance)
final protected __construct ( )

getInstanceOf() protected static method

* The overridden methods can't have a different signature, so there needs to be two functions: one, internal to a class, that calls this one (a singleton factory) that produces objects of the requested classes
protected static getInstanceOf ( $class )

instance() protected static method

Declarations that extend this method must have the same signature (arguments and returned types) to pass E_STRICT
protected static instance ( ) : object
return object instance