PHP Класс Ding\Container\Impl\ContainerImpl

PHP Version 5
Автор: Marcelo Gornstein ([email protected])
Наследование: implements Ding\Container\IContainer
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
__destruct ( ) : void Destructor, will call all beans destroy-methods.
__sleep ( ) : array Prevent serialization.
errorHandler ( integer $type, string $message, string $file, integer $line ) : true Called by php after set_error_handler()
eventDispatch ( $eventName, $data = null ) (non-PHPdoc)
eventListen ( $eventName, $beanName ) (non-PHPdoc)
fillAware ( Ding\Bean\BeanDefinition $def, object $bean ) : void Will look for "aware" kind of interfaces and inject whatever necessary.
getBean ( string $name ) : object Returns a bean.
getBeanDefinition ( string $name ) : Ding\Bean\BeanDefinition Returns a bean definition.
getBeansByClass ( $class ) (non-PHPdoc)
getBeansListeningOn ( $eventName ) (non-PHPdoc)
getInstance ( array $properties = [] ) : ContainerImpl This will return a container
getMessage ( $bundle, $message, array $arguments, $locale = 'default' ) (non-PHPdoc)
getResource ( $location, $context = false ) (non-PHPdoc)
registerBeanDefinitionProvider ( Ding\Bean\IBeanDefinitionProvider $provider ) (non-PHPdoc)
registerProperties ( array $properties ) (non-PHPdoc)
registerShutdownMethod ( object $bean, string $method ) : void Register a shutdown (destroy-method) method for a bean.
setMessageSource ( Ding\MessageSource\IMessageSource $messageSource ) Enter description here .
shutdownHandler ( ) : void Called by the vm after register_shutdown_function()
signalHandler ( integer $signo ) : void Called when a signal is caught.

Защищенные методы

Метод Описание
__construct ( array $options ) : void Constructor.
getClass ( string $class ) : ReflectionClass If we dont have a ReflectionFactory yet (i.e: didnt make the call to getBean() yet), replace it with this one.

Приватные методы

Метод Описание
_applyAspect ( $targetClass, Ding\Aspect\AspectDefinition $aspectDefinition, Ding\Aspect\Interceptor\IDispatcher $dispatcher ) : void Will inject into the given dispatcher the necessary information to aspects will be run correctly.
_applyAspects ( Ding\Bean\BeanDefinition $definition ) : void Applies specific bean aspects and global defined aspects.
_applyGlobalAspects ( Ding\Bean\BeanDefinition $definition, Ding\Aspect\Interceptor\IDispatcher $dispatcher ) : void Looks for any global aspects that may apply to this bean and applies them.
_applySpecificAspects ( Ding\Bean\BeanDefinition $definition, Ding\Aspect\Interceptor\IDispatcher $dispatcher ) : void Applies all aspects specifically defined for this bean definition.
_assemble ( mixed $bean, Ding\Bean\BeanDefinition $beanDefinition ) : void Assembles a bean (setter injection)
_createBean ( Ding\Bean\BeanDefinition $definition ) : object This will create a new bean, injecting all properties and applying all aspects.
_createBeanDependencies ( Ding\Bean\BeanDefinition $definition ) : void Creates whatever beans this definition depends on.
_getConstructorValuesForDefinition ( Ding\Bean\BeanDefinition $definition ) : object Resolves all values for constructor arguments definitions in a bean definition.
_getValueFromDefinition ( Ding\Bean\BeanPropertyDefinition | Ding\Bean\BeanConstructorArgumentDefinition $what ) : void This will resolve a property (or constructor arg) definition to a final value, being a bean reference, array of other properties (or constructor args), etc.
_instantiate ( Ding\Bean\BeanDefinition $definition ) : object Instantiates a bean.
_instantiateByConstructor ( Ding\Bean\BeanDefinition $definition ) : object Instantiates a bean using the constructor.
_instantiateByFactoryBean ( Ding\Bean\BeanDefinition $definition ) : object Instantiates a bean using a factory bean.
_instantiateByFactoryClass ( Ding\Bean\BeanDefinition $definition ) : object Instantiates a bean using a factory class.
_loadValue ( mixed $value ) : mixed Takes care of transforming a scalar value for a property or constructor argument, into a an actual value (i.e: if its a resource://, loading it first).
_nonSetterMethodInject ( object $bean, string $name, string $value ) : boolean Tries to inject by looking up a method of the given name.
_propertyInject ( object $bean, string $name, string $value ) : boolean Tries to inject by looking up a property by name.
_searchAndReplaceProperties ( string $value ) : string Will try to search and replace the properties found in the given value.
_setterInject ( object $bean, string $name, string $value ) : boolean Tries to inject by looking up set* methods.
_setupInitAndShutdown ( object $bean, Ding\Bean\BeanDefinition $definition ) : void Calls init method and register shutdown method.
_sortArgsWithNames ( Ding\Bean\BeanDefinition $definition, ReflectionMethod $rMethod )

Описание методов

__construct() защищенный Метод

Constructor.
protected __construct ( array $options ) : void
$options array options.
Результат void

__destruct() публичный Метод

Destructor, will call all beans destroy-methods.
public __destruct ( ) : void
Результат void

__sleep() публичный Метод

Prevent serialization.
public __sleep ( ) : array
Результат array

errorHandler() публичный Метод

Called by php after set_error_handler()
public errorHandler ( integer $type, string $message, string $file, integer $line ) : true
$type integer
$message string
$file string
$line integer
Результат true

eventDispatch() публичный Метод

(non-PHPdoc)
public eventDispatch ( $eventName, $data = null )

eventListen() публичный Метод

(non-PHPdoc)
public eventListen ( $eventName, $beanName )

fillAware() публичный Метод

Will look for "aware" kind of interfaces and inject whatever necessary.
public fillAware ( Ding\Bean\BeanDefinition $def, object $bean ) : void
$def Ding\Bean\BeanDefinition The Bean Definition
$bean object The bean
Результат void

getBean() публичный Метод

Returns a bean.
public getBean ( string $name ) : object
$name string Bean name.
Результат object

getBeanDefinition() публичный Метод

Returns a bean definition.
public getBeanDefinition ( string $name ) : Ding\Bean\BeanDefinition
$name string Bean name.
Результат Ding\Bean\BeanDefinition

getBeansByClass() публичный Метод

(non-PHPdoc)
public getBeansByClass ( $class )

getBeansListeningOn() публичный Метод

(non-PHPdoc)
public getBeansListeningOn ( $eventName )

getClass() защищенный Метод

If we dont have a ReflectionFactory yet (i.e: didnt make the call to getBean() yet), replace it with this one.
protected getClass ( string $class ) : ReflectionClass
$class string The name of a class.
Результат ReflectionClass

getInstance() публичный статический Метод

This will return a container
public static getInstance ( array $properties = [] ) : ContainerImpl
$properties array Container properties.
Результат ContainerImpl

getMessage() публичный Метод

(non-PHPdoc)
public getMessage ( $bundle, $message, array $arguments, $locale = 'default' )
$arguments array

getResource() публичный Метод

(non-PHPdoc)
public getResource ( $location, $context = false )

registerBeanDefinitionProvider() публичный Метод

(non-PHPdoc)
public registerBeanDefinitionProvider ( Ding\Bean\IBeanDefinitionProvider $provider )
$provider Ding\Bean\IBeanDefinitionProvider

registerProperties() публичный Метод

(non-PHPdoc)
public registerProperties ( array $properties )
$properties array

registerShutdownMethod() публичный Метод

Register a shutdown (destroy-method) method for a bean.
public registerShutdownMethod ( object $bean, string $method ) : void
$bean object Bean to call.
$method string Method to call.
Результат void

setMessageSource() публичный Метод

..
public setMessageSource ( Ding\MessageSource\IMessageSource $messageSource )
$messageSource Ding\MessageSource\IMessageSource

shutdownHandler() публичный Метод

Called by the vm after register_shutdown_function()
public shutdownHandler ( ) : void
Результат void

signalHandler() публичный Метод

Called when a signal is caught.
public signalHandler ( integer $signo ) : void
$signo integer
Результат void