$instances
$instances : static[]
Singleton instance.
Singleton trait.
The SingletonTrait
encapsulates a design pattern used to ensure that a class has only one
instance and provides a global point of access to that instance. By incorporating this trait
into a class, it enables the creation of a single instance of the class and restricts any
subsequent instantiations to return the same instance.
getInstance(string|null $basePath = null) : static
Get the singleton instance.
This method returns the singleton instance of the class. If an instance doesn't exist, it creates one and returns it.
string|null | $basePath | Holds the Omega application base path or null. |
Return the singleton instance.
__clone() : void
Clone method.
This method is overridden to prevent cloning of the singleton instance. Cloning would create a second instance, which violates the Singleton pattern.
If an attempt to clone the singleton is made.
__wakeup() : void
Wakeup method.
This method is overridden to prevent deserialization of the singleton instance. Deserialization would create a second instance, which violates the Singleton pattern.
If an attempt at deserialization is made.
__sleep() : array
Sleep method.
This method is overridden to prevent serialization of the singleton instance. Serialization would create a second instance, which violates the Singleton pattern.
If an attempt at serialization is made.
Return the names of private properties in parent classes.