TYPO3CMS  8
 All Classes Namespaces Files Functions Variables Pages
ObjectManager Class Reference
Inheritance diagram for ObjectManager:
ObjectManagerInterface SingletonInterface

Public Member Functions

 __construct ()
 
 __sleep ()
 
 __wakeup ()
 
 isRegistered ($objectName)
 
 get ($objectName)
 
 getScope ($objectName)
 
 getEmptyObject ($className)
 

Protected Attributes

 $objectContainer
 

Detailed Description

Implementation of the default Extbase Object Manager

Definition at line 22 of file ObjectManager.php.

Constructor & Destructor Documentation

__construct ( )

Constructs a new Object Manager

Definition at line 32 of file ObjectManager.php.

References GeneralUtility\makeInstance().

Referenced by ObjectManager\__wakeup().

Member Function Documentation

__sleep ( )

Serialization (sleep) helper.

Removes properties of this object from serialization. This action is necessary, since there might be closures used in the accordant content objects (e.g. in FLUIDTEMPLATE) which cannot be serialized. It's fine to reset $this->contentObjects since elements will be recreated and are just a local cache, but not required for runtime logic and behaviour.

See also
http://forge.typo3.org/issues/36820
Returns
array Names of the properties to be serialized

Definition at line 50 of file ObjectManager.php.

__wakeup ( )

Unserialization (wakeup) helper.

Initializes the properties again that have been removed by a call to the __sleep() method on serialization before.

See also
http://forge.typo3.org/issues/36820
Returns
void

Definition at line 68 of file ObjectManager.php.

References ObjectManager\__construct().

get (   $objectName)

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

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

Implements ObjectManagerInterface.

Definition at line 91 of file ObjectManager.php.

getEmptyObject (   $className)

Create an instance of $className without calling its constructor

Parameters
string$className
Returns
object

Implements ObjectManagerInterface.

Definition at line 127 of file ObjectManager.php.

getScope (   $objectName)

Returns the scope of the specified object.

Parameters
string$objectNameThe object name
Returns
int One of the Container::SCOPE_ constants
Exceptions
TYPO3

Implements ObjectManagerInterface.

Definition at line 112 of file ObjectManager.php.

References ObjectManager\isRegistered(), Container\SCOPE_PROTOTYPE, and Container\SCOPE_SINGLETON.

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

Implements ObjectManagerInterface.

Definition at line 79 of file ObjectManager.php.

Referenced by ObjectManager\getScope().

Member Data Documentation

$objectContainer
protected

Definition at line 27 of file ObjectManager.php.