StaticInstanceTrait
StaticInstanceTrait provides methods to satisfy [[StaticInstanceInterface]] interface.
Tags
Table of Contents
Properties
- $_instances : array<string|int, static>
Methods
- instance() : static
- Returns static class instance, which can be used to obtain meta information.
Properties
$_instances
private
static array<string|int, static>
$_instances
= []
static instances in format: [className => object]
Methods
instance()
Returns static class instance, which can be used to obtain meta information.
public
static instance([bool $refresh = false ]) : static
Parameters
- $refresh : bool = false
-
whether to re-create static instance even, if it is already cached.
Return values
static —class instance.