class Singleton (View source)

This implementation of the singleton pattern does not conform to the strong definition given by the "Gang of Four." The __construct() method has not be privatized so that a singleton pattern is capable of being achieved; however, multiple instantiations are also possible. This allows the user more freedom with this pattern.

Methods

static object
instance()

Static method for instantiating a singleton object.

string
get_called_class()

Similar to a get_called_class() for a child class to invoke.

Details

final static object instance()

Static method for instantiating a singleton object.

Return Value

object

final protected string get_called_class()

Similar to a get_called_class() for a child class to invoke.

Return Value

string