Singleton
trait Singleton (View source)
Properties
static protected | $instances |
Methods
__construct()
Protected class constructor to prevent direct object creation.
void
__clone()
Prevent object cloning
void
__wakeup()
Singletons should not be restorable from strings.
static Singleton
getInstance()
To return new or existing Singleton instance of the class from which it is called.
Details
protected
__construct()
Protected class constructor to prevent direct object creation.
final protected void
__clone()
Prevent object cloning
void
__wakeup()
Singletons should not be restorable from strings.
final static Singleton
getInstance()
To return new or existing Singleton instance of the class from which it is called.
As it sets to final it can't be overridden.