public
|
|
public
Joomla\DI\Container
|
#
alias( string $alias, string $key )
Create an alias for a given key for easy access.
Create an alias for a given key for easy access.
Parameters
- $alias
string - $alias The alias name
- $key
string - $key The key to alias
Returns
Since
1.0
|
protected
string
|
#
resolveAlias( string $key )
Search the aliases property for a matching alias key.
Search the aliases property for a matching alias key.
Parameters
- $key
string - $key The key to search for.
Returns
string
Since
1.0
|
public
mixed
|
#
buildObject( string $key, boolean $shared = false )
Build an object of class $key;
Build an object of class $key;
Parameters
- $key
string - $key The class name to build.
- $shared
boolean - $shared True to create a shared resource.
Returns
mixed - Instance of class specified by $key with all dependencies injected. Returns an
object if the class exists and false otherwise
Since
1.0
|
public
object
|
#
buildSharedObject( string $key )
Convenience method for building a shared object.
Convenience method for building a shared object.
Parameters
- $key
string - $key The class name to build.
Returns
object - Instance of class specified by $key with all dependencies injected.
Since
1.0
|
public
Joomla\DI\Container
|
#
createChild( )
Create a child Container with a new property scope that that has the ability
to access the parent scope when resolving.
Create a child Container with a new property scope that that has the ability
to access the parent scope when resolving.
Returns
Since
1.0
|
public
|
#
extend( string $key, Closure $callable )
Extend a defined service Closure by wrapping the existing one with a new
Closure. This works very similar to a decorator pattern. Note that this only
works on service Closures that have been defined in the current Provider, not
parent providers.
Extend a defined service Closure by wrapping the existing one with a new
Closure. This works very similar to a decorator pattern. Note that this only
works on service Closures that have been defined in the current Provider, not
parent providers.
Parameters
- $key
string - $key The unique identifier for the Closure or property.
- $callable
Closure - $callable A Closure to wrap the original service Closure.
Throws
Since
1.0
|
protected
array
|
#
getMethodArgs( ReflectionMethod $method )
Build an array of constructor parameters.
Build an array of constructor parameters.
Parameters
- $method
ReflectionMethod - $method Method for which to build the argument array.
Returns
array - Array of arguments to pass to the method.
Throws
Since
1.0
|
public
Joomla\DI\Container
|
#
set( string $key, mixed $value, boolean $shared = false, boolean $protected = false )
Method to set the key and callback to the dataStore array.
Method to set the key and callback to the dataStore array.
Parameters
- $key
string - $key Name of dataStore key to set.
- $value
mixed - $value Callable function to run or string to retrive when requesting the
specified $key.
- $shared
boolean - $shared True to create and store a shared instance.
- $protected
boolean - $protected True to protect this item from being overwritten. Useful for
services.
Returns
Throws
Since
1.0
|
public
Joomla\DI\Container
|
#
protect( string $key, callable $callback, boolean $shared = false )
Convenience method for creating protected keys.
Convenience method for creating protected keys.
Parameters
- $key
string - $key Name of dataStore key to set.
- $callback
callable - $callback Callable function to run when requesting the specified $key.
- $shared
boolean - $shared True to create and store a shared instance.
Returns
Since
1.0
|
public
Joomla\DI\Container
|
#
share( string $key, callable $callback, boolean $protected = false )
Convenience method for creating shared keys.
Convenience method for creating shared keys.
Parameters
- $key
string - $key Name of dataStore key to set.
- $callback
callable - $callback Callable function to run when requesting the specified $key.
- $protected
boolean - $protected True to create and store a shared instance.
Returns
Since
1.0
|
public
mixed
|
#
get( string $key, boolean $forceNew = false )
Method to retrieve the results of running the $callback for the specified
$key;
Method to retrieve the results of running the $callback for the specified
$key;
Parameters
- $key
string - $key Name of the dataStore key to get.
- $forceNew
boolean - $forceNew True to force creation and return of a new instance.
Returns
mixed - Results of running the $callback for the specified $key.
Throws
Since
1.0
|
public
boolean
|
#
exists( string $key )
Method to check if specified dataStore key exists.
Method to check if specified dataStore key exists.
Parameters
- $key
string - $key Name of the dataStore key to check.
Returns
boolean - True for success
Since
1.0
|
protected
mixed
|
#
getRaw( string $key )
Get the raw data assigned to a key.
Get the raw data assigned to a key.
Parameters
- $key
string - $key The key for which to get the stored item.
Returns
mixed
Since
1.0
|
public
mixed
|
#
getNewInstance( string $key )
Method to force the container to return a new instance of the results of the
callback for requested $key.
Method to force the container to return a new instance of the results of the
callback for requested $key.
Parameters
- $key
string - $key Name of the dataStore key to get.
Returns
mixed - Results of running the $callback for the specified $key.
Since
1.0
|
public
Joomla\DI\Container
|
|