![]() |
TYPO3
7.6
|
Public Member Functions | |
__construct () | |
getInstance ($className, $givenConstructorArguments=array()) | |
getEmptyObject ($className) | |
registerImplementation ($className, $alternativeClassName) | |
getImplementationClassName ($className) | |
isSingleton ($className) | |
isPrototype ($className) | |
Public Attributes | |
const | SCOPE_PROTOTYPE = 1 |
const | SCOPE_SINGLETON = 2 |
Protected Member Functions | |
getClassInfoFactory () | |
getClassInfoCache () | |
getInstantiator () | |
getInstanceInternal ($className, $givenConstructorArguments=array()) | |
instanciateObject (\TYPO3\CMS\Extbase\Object\Container\ClassInfo $classInfo, array $givenConstructorArguments) | |
injectDependencies ($instance,\TYPO3\CMS\Extbase\Object\Container\ClassInfo $classInfo) | |
initializeObject ($instance,\TYPO3\CMS\Extbase\Object\Container\ClassInfo $classInfo) | |
log ($message, $severity) | |
Protected Attributes | |
$instantiator = null | |
Private Member Functions | |
getConstructorArguments ($className,\TYPO3\CMS\Extbase\Object\Container\ClassInfo $classInfo, array $givenConstructorArguments) | |
getClassInfo ($className) | |
Private Attributes | |
$cache = null | |
$alternativeImplementation | |
$classInfoFactory = null | |
$singletonInstances = array() | |
$prototypeObjectsWhichAreCurrentlyInstanciated | |
Internal TYPO3 Dependency Injection container
Definition at line 20 of file Container.php.
__construct | ( | ) |
Constructor is protected since container should be a singleton.
Definition at line 72 of file Container.php.
|
private |
Gets Classinfos for the className - using the cache and the factory
string | $className |
Definition at line 344 of file Container.php.
References Container\getClassInfoCache(), and Container\getClassInfoFactory().
Referenced by Container\getEmptyObject(), Container\getInstanceInternal(), and Container\isSingleton().
|
protected |
Internal method to create the classInfoCache, extracted to be mockable.
Definition at line 94 of file Container.php.
References Container\$cache.
Referenced by Container\getClassInfo().
|
protected |
Internal method to create the classInfoFactory, extracted to be mockable.
Definition at line 81 of file Container.php.
References Container\$classInfoFactory.
Referenced by Container\getClassInfo().
|
private |
gets array of parameter that can be used to call a constructor
string | $className | |
\TYPO3\CMS\Extbase\Object\Container\ClassInfo | $classInfo | |
array | $givenConstructorArguments |
\InvalidArgumentException |
Definition at line 295 of file Container.php.
References elseif, Container\getInstanceInternal(), and Container\log().
Referenced by Container\instanciateObject().
getEmptyObject | ( | $className | ) |
Create an instance of $className without calling its constructor
string | $className |
Definition at line 135 of file Container.php.
References Container\getClassInfo(), Container\getImplementationClassName(), Container\getInstantiator(), Container\initializeObject(), and Container\injectDependencies().
getImplementationClassName | ( | $className | ) |
Returns the class name for a new instance, taking into account the class-extension API.
string | $className | Base class name to evaluate |
Definition at line 327 of file Container.php.
Referenced by Container\getEmptyObject(), and Container\getInstanceInternal().
getInstance | ( | $className, | |
$givenConstructorArguments = array() |
|||
) |
Main method which should be used to get an instance of the wished class specified by $className.
string | $className | |
array | $givenConstructorArguments | the list of constructor arguments as array |
Definition at line 123 of file Container.php.
References Container\getInstanceInternal().
|
protected |
Internal implementation for getting a class.
string | $className | |
array | $givenConstructorArguments | the list of constructor arguments as array |
\TYPO3\CMS\Extbase\Object\Exception | |
\TYPO3\CMS\Extbase\Object\Exception\CannotBuildObjectException |
Definition at line 154 of file Container.php.
References Container\getClassInfo(), Container\getImplementationClassName(), Container\initializeObject(), Container\injectDependencies(), and Container\instanciateObject().
Referenced by Container\getConstructorArguments(), Container\getInstance(), and Container\injectDependencies().
|
protected |
Internal method to create the class instantiator, extracted to be mockable
Definition at line 107 of file Container.php.
References Container\$instantiator.
Referenced by Container\getEmptyObject().
|
protected |
Call object initializer if present in object
object | $instance | |
\TYPO3\CMS\Extbase\Object\Container\ClassInfo | $classInfo |
Definition at line 255 of file Container.php.
Referenced by Container\getEmptyObject(), and Container\getInstanceInternal().
|
protected |
Inject setter-dependencies into $instance
object | $instance | |
\TYPO3\CMS\Extbase\Object\Container\ClassInfo | $classInfo |
Definition at line 223 of file Container.php.
References Container\getInstanceInternal(), and Container\log().
Referenced by Container\getEmptyObject(), and Container\getInstanceInternal().
|
protected |
Instanciates an object, possibly setting the constructor dependencies. Additionally, directly registers all singletons in the singleton registry, such that circular references of singletons are correctly instanciated.
\TYPO3\CMS\Extbase\Object\Container\ClassInfo | $classInfo | |
array | $givenConstructorArguments |
\TYPO3\CMS\Extbase\Object\Exception |
Definition at line 200 of file Container.php.
References Container\getConstructorArguments().
Referenced by Container\getInstanceInternal().
isPrototype | ( | $className | ) |
string | $className |
Definition at line 370 of file Container.php.
References Container\isSingleton().
isSingleton | ( | $className | ) |
string | $className |
Definition at line 360 of file Container.php.
References Container\getClassInfo().
Referenced by ClassInfo\__construct(), and Container\isPrototype().
|
protected |
Wrapper for dev log, in order to ease testing
string | $message | Message (in english). |
int | $severity | Severity: 0 is info, 1 is notice, 2 is warning, 3 is fatal error, -1 is "OK" message |
Definition at line 269 of file Container.php.
Referenced by Container\getConstructorArguments(), and Container\injectDependencies().
registerImplementation | ( | $className, | |
$alternativeClassName | |||
) |
register a classname that should be used if a dependency is required. e.g. used to define default class for an interface
string | $className | |
string | $alternativeClassName |
Definition at line 281 of file Container.php.
|
private |
Definition at line 38 of file Container.php.
|
private |
Definition at line 30 of file Container.php.
Referenced by Container\getClassInfoCache().
|
private |
Definition at line 45 of file Container.php.
Referenced by Container\getClassInfoFactory().
|
protected |
Definition at line 50 of file Container.php.
Referenced by Container\getInstantiator().
|
private |
Definition at line 64 of file Container.php.
|
private |
Definition at line 57 of file Container.php.
const SCOPE_PROTOTYPE = 1 |
Definition at line 22 of file Container.php.
Referenced by ObjectManager\getScope().
const SCOPE_SINGLETON = 2 |
Definition at line 23 of file Container.php.
Referenced by ObjectManager\getScope().