Avolutions\Core\AbstractSingleton
An abstract class which implements the singleton pattern.
Properties
Property | Visibility | Type | Description |
---|---|---|---|
$instances | protected | array | An array of all instance of singleton classes |
Methods
Method | Visibility | Description |
---|---|---|
getInstance() | public | Returns an instance of the called class. If there is no instance so far, a new instance is created and returned. Otherwise, the existing one is returned (singleton). |
setInstance() | public | Set the instance of the given class. |
Property Details
$instances
An array of all instance of singleton classes
protected static array<string|int, mixed> $instances = []
Method Details
getInstance()
Returns an instance of the called class. If there is no instance so far, a new instance is created and returned. Otherwise, the existing one is returned (singleton).
public
final static getInstance() : object