TYPO3  7.6
Public Member Functions | List of all members
ObjectManagerInterfaceException Interface Reference
Inheritance diagram for ObjectManagerInterfaceException:
SingletonInterface ObjectManagerException

Public Member Functions

 isRegistered ($objectName)
 
 get ($objectName)
 
 create ($objectName)
 
 getEmptyObject ($className)
 

Detailed Description

Interface for the TYPO3 Object Manager

Definition at line 20 of file ObjectManagerInterfaceException.php.

Member Function Documentation

create (   $objectName)

Creates a fresh instance of the object specified by $objectName.

This factory method can only create objects of the scope prototype. Singleton objects must be either injected by some type of Dependency Injection or if that is not possible, be retrieved by the get() method of the Object Manager

Parameters
string$objectNameThe name of the object to create
Returns
object The new object instance
Exceptions
\TYPO3\CMS\Extbase\Object\Exception\WrongScopeExceptionif the created object is not of scope prototype

Implemented in ObjectManagerException.

get (   $objectName)

Returns a fresh or existing instance of the object specified by $objectName.

Important:

If possible, instances of Prototype objects should always be created with the Object Manager's create() method and Singleton objects should rather be injected by some type of Dependency Injection.

Parameters
string$objectNameThe name of the object to return an instance of
Returns
object The object instance

Implemented in ObjectManagerException.

getEmptyObject (   $className)

Create an instance of $className without calling its constructor

Parameters
string$className
Returns
object

Implemented in ObjectManagerException.

isRegistered (   $objectName)

Returns TRUE if an object with the given name is registered

Parameters
string$objectNameName of the object
Returns
bool TRUE if the object has been registered, otherwise FALSE

Implemented in ObjectManagerException.