PHP 클래스 Neos\Flow\ObjectManagement\ObjectManager

상속: implements Neos\Flow\ObjectManagement\ObjectManagerInterface
파일 보기 프로젝트 열기: neos/flow-development-collection 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$allSettings array An array of settings of all packages, indexed by package key
$cachedLowerCasedObjectNames array
$classesBeingInstantiated array
$context Neos\Flow\Core\ApplicationContext The configuration context for this Flow run
$dependencyProxies array
$internalShutdownObjects SplObjectStorage These shutdown method will be called after all other shutdown methods have been called.
$objectSerializer ObjectSerializer
$objects array
$shutdownObjects SplObjectStorage A SplObjectStorage containing those objects which need to be shutdown when the container shuts down. Each value of each entry is the respective shutdown method name.

공개 메소드들

메소드 설명
__construct ( ApplicationContext $context ) Constructor for this Object Container
createLazyDependency ( string $hash, &$propertyReferenceVariable, string $className, Closure $builder ) : DependencyProxy Creates a new DependencyProxy class for a dependency built through code identified through "hash" for a dependency of class $className. The closure in $builder contains code for actually creating the dependency instance once it needs to be materialized.
forgetInstance ( string $objectName ) : void Unsets the instance of the given object
get ( string $objectName ) : object Returns a fresh or existing instance of the object specified by $objectName.
getAllObjectConfigurations ( ) : array Returns all current object configurations.
getCaseSensitiveObjectName ( string $caseInsensitiveObjectName ) : mixed Returns the case sensitive object name of an object specified by a case insensitive object name. If no object of that name exists, FALSE is returned.
getClassNameByObjectName ( string $objectName ) : string Returns the implementation class name for the specified object
getContext ( ) : ApplicationContext Returns the context Flow is running in.
getInstance ( string $objectName ) : object Returns the instance of the specified object or NULL if no instance has been registered yet.
getLazyDependencyByHash ( string $hash, &$propertyReferenceVariable ) : mixed This method is used internally to retrieve either an actual (singleton) instance of the specified dependency or, if no instance exists yet, a Dependency Proxy object which automatically triggers the creation of an instance as soon as it is used the first time.
getObjectNameByClassName ( string $className ) : string Returns the object name corresponding to a given class name.
getPackageKeyByObjectName ( string $objectName ) : string Returns the key of the package the specified object is contained in.
getScope ( string $objectName ) : integer Returns the scope of the specified object.
getSessionInstances ( ) : array Returns all instances of objects with scope session
getSettingsByPath ( array $settingsPath ) : mixed Returns the an array of package settings or a single setting value by the given path.
hasInstance ( string $objectName ) : boolean Returns TRUE if this object manager already has an instance for the specified object.
injectAllSettings ( array $settings ) : void Injects the global settings array, indexed by package key.
isRegistered ( string $objectName ) : boolean Returns TRUE if an object with the given name is registered
registerShutdownObject ( object $object, string $shutdownLifecycleMethodName ) : void Registers the passed shutdown lifecycle method for the given object
setInstance ( string $objectName, object $instance ) : void Sets the instance of the given object
setObjects ( array $objects ) : void Sets the objects array
shutdown ( ) : void Shuts down this Object Container by calling the shutdown methods of all object instances which were configured to be shut down.

보호된 메소드들

메소드 설명
buildObjectByFactory ( string $objectName ) : object Invokes the Factory defined in the object configuration of the specified object in order to build an instance. Arguments which were defined in the object configuration are passed to the factory method.
callShutdownMethods ( SplObjectStorage $shutdownObjects ) : void Executes the methods of the provided objects.
instantiateClass ( string $className, array $arguments ) : object Speed optimized alternative to ReflectionClass::newInstanceArgs()

메소드 상세

__construct() 공개 메소드

Constructor for this Object Container
public __construct ( ApplicationContext $context )
$context Neos\Flow\Core\ApplicationContext The configuration context for this Flow run

buildObjectByFactory() 보호된 메소드

Invokes the Factory defined in the object configuration of the specified object in order to build an instance. Arguments which were defined in the object configuration are passed to the factory method.
protected buildObjectByFactory ( string $objectName ) : object
$objectName string Name of the object to build
리턴 object The built object

callShutdownMethods() 보호된 메소드

Executes the methods of the provided objects.
protected callShutdownMethods ( SplObjectStorage $shutdownObjects ) : void
$shutdownObjects SplObjectStorage
리턴 void

createLazyDependency() 공개 메소드

Internally used by the injectProperties method of generated proxy classes.
public createLazyDependency ( string $hash, &$propertyReferenceVariable, string $className, Closure $builder ) : DependencyProxy
$hash string An md5 hash over the code needed to actually build the dependency instance
$className string Name of the class of the dependency which eventually will be instantiated
$builder Closure An anonymous function which creates the instance to be injected
리턴 Neos\Flow\ObjectManagement\DependencyInjection\DependencyProxy

forgetInstance() 공개 메소드

If run during standard runtime, the whole application might become unstable because certain parts might already use an instance of this object. Therefore this method should only be used in a setUp() method of a functional test case.
public forgetInstance ( string $objectName ) : void
$objectName string The object name
리턴 void

get() 공개 메소드

Returns a fresh or existing instance of the object specified by $objectName.
public get ( string $objectName ) : object
$objectName string The name of the object to return an instance of
리턴 object The object instance

getAllObjectConfigurations() 공개 메소드

For internal use in bootstrap only. Can change anytime.
public getAllObjectConfigurations ( ) : array
리턴 array

getCaseSensitiveObjectName() 공개 메소드

In general, the case sensitive variant is used everywhere in Flow, however there might be special situations in which the case sensitive name is not available. This method helps you in these rare cases.
public getCaseSensitiveObjectName ( string $caseInsensitiveObjectName ) : mixed
$caseInsensitiveObjectName string The object name in lower-, upper- or mixed case
리턴 mixed Either the mixed case object name or FALSE if no object of that name was found.

getClassNameByObjectName() 공개 메소드

Returns the implementation class name for the specified object
public getClassNameByObjectName ( string $objectName ) : string
$objectName string The object name
리턴 string The class name corresponding to the given object name or FALSE if no such object is registered

getContext() 공개 메소드

Returns the context Flow is running in.
public getContext ( ) : ApplicationContext
리턴 Neos\Flow\Core\ApplicationContext The context, for example "Development" or "Production"

getInstance() 공개 메소드

Returns the instance of the specified object or NULL if no instance has been registered yet.
public getInstance ( string $objectName ) : object
$objectName string The object name
리턴 object The object or NULL

getLazyDependencyByHash() 공개 메소드

Internally used by the injectProperties method of generated proxy classes.
public getLazyDependencyByHash ( string $hash, &$propertyReferenceVariable ) : mixed
$hash string
리턴 mixed

getObjectNameByClassName() 공개 메소드

Returns the object name corresponding to a given class name.
public getObjectNameByClassName ( string $className ) : string
$className string The class name
리턴 string The object name corresponding to the given class name or FALSE if no object is configured to use that class

getPackageKeyByObjectName() 공개 메소드

Returns the key of the package the specified object is contained in.
public getPackageKeyByObjectName ( string $objectName ) : string
$objectName string The object name
리턴 string The package key or FALSE if no such object exists

getScope() 공개 메소드

Returns the scope of the specified object.
public getScope ( string $objectName ) : integer
$objectName string The object name
리턴 integer One of the Configuration::SCOPE_ constants

getSessionInstances() 공개 메소드

Returns all instances of objects with scope session
public getSessionInstances ( ) : array
리턴 array

getSettingsByPath() 공개 메소드

Returns the an array of package settings or a single setting value by the given path.
public getSettingsByPath ( array $settingsPath ) : mixed
$settingsPath array Path to the setting(s) as an array, for example array('Neos', 'Flow', 'persistence', 'backendOptions')
리턴 mixed Either an array of settings or the value of a single setting

hasInstance() 공개 메소드

Returns TRUE if this object manager already has an instance for the specified object.
public hasInstance ( string $objectName ) : boolean
$objectName string The object name
리턴 boolean TRUE if an instance already exists

injectAllSettings() 공개 메소드

Injects the global settings array, indexed by package key.
public injectAllSettings ( array $settings ) : void
$settings array The global settings
리턴 void

instantiateClass() 보호된 메소드

Speed optimized alternative to ReflectionClass::newInstanceArgs()
protected instantiateClass ( string $className, array $arguments ) : object
$className string Name of the class to instantiate
$arguments array Arguments to pass to the constructor
리턴 object The object

isRegistered() 공개 메소드

Returns TRUE if an object with the given name is registered
public isRegistered ( string $objectName ) : boolean
$objectName string Name of the object
리턴 boolean TRUE if the object has been registered, otherwise FALSE

registerShutdownObject() 공개 메소드

Registers the passed shutdown lifecycle method for the given object
public registerShutdownObject ( object $object, string $shutdownLifecycleMethodName ) : void
$object object The object to register the shutdown method for
$shutdownLifecycleMethodName string The method name of the shutdown method to be called
리턴 void

setInstance() 공개 메소드

Objects of scope sessions are assumed to be the real session object, not the lazy loading proxy.
public setInstance ( string $objectName, object $instance ) : void
$objectName string The object name
$instance object A prebuilt instance
리턴 void

setObjects() 공개 메소드

Sets the objects array
public setObjects ( array $objects ) : void
$objects array An array of object names and some information about each registered object (scope, lower cased name etc.)
리턴 void

shutdown() 공개 메소드

Shuts down this Object Container by calling the shutdown methods of all object instances which were configured to be shut down.
public shutdown ( ) : void
리턴 void

프로퍼티 상세

$allSettings 보호되어 있는 프로퍼티

An array of settings of all packages, indexed by package key
protected array $allSettings
리턴 array

$cachedLowerCasedObjectNames 보호되어 있는 프로퍼티

protected array $cachedLowerCasedObjectNames
리턴 array

$classesBeingInstantiated 보호되어 있는 프로퍼티

protected array $classesBeingInstantiated
리턴 array

$context 보호되어 있는 프로퍼티

The configuration context for this Flow run
protected ApplicationContext,Neos\Flow\Core $context
리턴 Neos\Flow\Core\ApplicationContext

$dependencyProxies 보호되어 있는 프로퍼티

protected array $dependencyProxies
리턴 array

$internalShutdownObjects 보호되어 있는 프로퍼티

These shutdown method will be called after all other shutdown methods have been called.
protected SplObjectStorage $internalShutdownObjects
리턴 SplObjectStorage

$objectSerializer 보호되어 있는 프로퍼티

protected ObjectSerializer,Neos\Flow\ObjectManagement $objectSerializer
리턴 ObjectSerializer

$objects 보호되어 있는 프로퍼티

protected array $objects
리턴 array

$shutdownObjects 보호되어 있는 프로퍼티

A SplObjectStorage containing those objects which need to be shutdown when the container shuts down. Each value of each entry is the respective shutdown method name.
protected SplObjectStorage $shutdownObjects
리턴 SplObjectStorage