MultipleInstanceManager
abstract class MultipleInstanceManager (View source)
Properties
protected Application | $app | The application instance. |
|
protected array | $instances | The array of resolved instances. |
|
protected array | $customCreators | The registered custom instance creators. |
Methods
Get the default instance name.
Set the default instance name.
Get the instance specific configuration.
Get an instance instance by name.
Attempt to get an instance from the local cache.
Resolve the given instance.
Call a custom instance creator.
Unset the given instances.
Disconnect the given instance and remove from local cache.
Dynamically call the default instance.
Details
void
__construct(Application $app)
Create a new manager instance.
abstract string
getDefaultInstance()
Get the default instance name.
abstract void
setDefaultInstance(string $name)
Set the default instance name.
abstract array
getInstanceConfig(string $name)
Get the instance specific configuration.
mixed
instance(string|null $name = null)
Get an instance instance by name.
protected mixed
get(string $name)
Attempt to get an instance from the local cache.
protected mixed
resolve(string $name)
Resolve the given instance.
protected mixed
callCustomCreator(array $config)
Call a custom instance creator.
$this
forgetInstance(array|string|null $name = null)
Unset the given instances.
void
purge(string|null $name = null)
Disconnect the given instance and remove from local cache.
$this
extend(string $name, Closure $callback)
Register a custom instance creator Closure.
mixed
__call(string $method, array $parameters)
Dynamically call the default instance.