PHP Интерфейс Neos\Flow\ObjectManagement\ObjectManagerInterface

Показать файл Открыть проект Примеры использования интерфейса

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

Метод Описание
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.

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

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() публичный Метод

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
Результат object The object instance

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 currently set context.
public getContext ( ) : ApplicationContext
Результат Neos\Flow\Core\ApplicationContext the current context

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

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

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

Returns TRUE if an object with the given name has already been registered.
С версии: 1.0.0 alpha 8
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() публичный Метод

Sets the instance of the given object
public setInstance ( string $objectName, object $instance ) : void
$objectName string The object name
$instance object A prebuilt instance
Результат void

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

Shuts the object manager down and calls the shutdown methods of all objects which are configured for it.
public shutdown ( ) : void
Результат void