Elgg  Version 2.2
 All Classes Namespaces Files Functions Variables Pages
Public Member Functions | Public Attributes | List of all members
Elgg\Di\DiContainer Class Reference
Inheritance diagram for Elgg\Di\DiContainer:
Elgg\Di\ServiceProvider

Public Member Functions

 __get ($name)
 Fetch a value. More...
 
 setValue ($name, $value)
 Set a value to be returned without modification. More...
 
 setFactory ($name, $callable, $shared=true)
 Set a factory to generate a value when the container is read. More...
 
 setClassName ($name, $class_name, $shared=true)
 Set a factory based on instantiating a class with no arguments. More...
 
 remove ($name)
 Remove a value from the container. More...
 
 has ($name)
 Does the container have this value. More...
 
 getNames ()
 Get names for all values/factories. More...
 

Public Attributes

const CLASS_NAME_PATTERN_53 = '/^(\\\\?[a-z_\x7f-\xff][a-z0-9_\x7f-\xff]*)+$/i'
 

Detailed Description

Definition at line 28 of file DiContainer.php.

Member Function Documentation

Elgg\Di\DiContainer::__get (   $name)

Fetch a value.

Parameters
string$nameThe name of the value to fetch
Returns
mixed
Exceptions
\Elgg\Di\MissingValueException

Definition at line 44 of file DiContainer.php.

Elgg\Di\DiContainer::getNames ( )

Get names for all values/factories.

private

Definition at line 185 of file DiContainer.php.

Elgg\Di\DiContainer::has (   $name)

Does the container have this value.

Parameters
string$nameThe name of the value
Returns
bool

Definition at line 168 of file DiContainer.php.

Elgg\Di\DiContainer::remove (   $name)

Remove a value from the container.

Parameters
string$nameThe name of the value
Returns

Definition at line 153 of file DiContainer.php.

Elgg\Di\DiContainer::setClassName (   $name,
  $class_name,
  $shared = true 
)

Set a factory based on instantiating a class with no arguments.

Parameters
string$nameName of the value
string$class_nameClass name to be instantiated
bool$sharedWhether the same value should be returned for every request
Returns
Exceptions
\InvalidArgumentException

Definition at line 133 of file DiContainer.php.

Elgg\Di\DiContainer::setFactory (   $name,
  $callable,
  $shared = true 
)

Set a factory to generate a value when the container is read.

Parameters
string$nameThe name of the value
callable$callableFactory for the value
bool$sharedWhether the same value should be returned for every request
Returns
Exceptions
\InvalidArgumentException

Definition at line 109 of file DiContainer.php.

Elgg\Di\DiContainer::setValue (   $name,
  $value 
)

Set a value to be returned without modification.

Parameters
string$nameThe name of the value
mixed$valueThe value
Returns
Exceptions
\InvalidArgumentException

Definition at line 91 of file DiContainer.php.

Member Data Documentation

const Elgg\Di\DiContainer::CLASS_NAME_PATTERN_53 = '/^(\\\\?[a-z_\x7f-\xff][a-z0-9_\x7f-\xff]*)+$/i'

Definition at line 35 of file DiContainer.php.


The documentation for this class was generated from the following file: