PHP Interface Neos\Flow\ObjectManagement\ObjectManagerInterface

Afficher le fichier Open project: neos/flow-development-collection Interface Usage Examples

Méthodes publiques

Méthode Description
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.
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 currently set context.
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
isRegistered ( string $objectName ) : boolean Returns TRUE if an object with the given name has already been 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
shutdown ( ) : void Shuts the object manager down and calls the shutdown methods of all objects which are configured for it.

Method Details

forgetInstance() public méthode

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
Résultat void

get() public méthode

Important: If possible, instances of Prototype objects should always be created with the new keyword and Singleton objects should rather be injected by some type of Dependency Injection.
public get ( string $objectName ) : object
$objectName string The name of the object to return an instance of
Résultat object The object instance

getCaseSensitiveObjectName() public méthode

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
Résultat mixed Either the mixed case object name or FALSE if no object of that name was found.

getClassNameByObjectName() public méthode

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

getContext() public méthode

Returns the currently set context.
public getContext ( ) : ApplicationContext
Résultat Neos\Flow\Core\ApplicationContext the current context

getObjectNameByClassName() public méthode

Returns the object name corresponding to a given class name.
public getObjectNameByClassName ( string $className ) : string
$className string The class name
Résultat string The object name corresponding to the given class name

getPackageKeyByObjectName() public méthode

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

getScope() public méthode

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

getSessionInstances() public méthode

Returns all instances of objects with scope session
public getSessionInstances ( ) : array
Résultat array

isRegistered() public méthode

Returns TRUE if an object with the given name has already been registered.
Since: 1.0.0 alpha 8
public isRegistered ( string $objectName ) : boolean
$objectName string Name of the object
Résultat boolean TRUE if the object has been registered, otherwise FALSE

registerShutdownObject() public méthode

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
Résultat void

setInstance() public méthode

Sets the instance of the given object
public setInstance ( string $objectName, object $instance ) : void
$objectName string The object name
$instance object A prebuilt instance
Résultat void

shutdown() public méthode

Shuts the object manager down and calls the shutdown methods of all objects which are configured for it.
public shutdown ( ) : void
Résultat void