‪TYPO3CMS  9.5
TYPO3\CMS\Extbase\Object\ObjectManager Class Reference
Inheritance diagram for TYPO3\CMS\Extbase\Object\ObjectManager:
TYPO3\CMS\Extbase\Object\ObjectManagerInterface TYPO3\CMS\Core\SingletonInterface

Public Member Functions

 __construct ()
 
array __sleep ()
 
 __wakeup ()
 
bool isRegistered ($objectName)
 
object &T get ($objectName,... $constructorArguments)
 
int getScope ($objectName)
 
object &T getEmptyObject ($className)
 

Protected Attributes

TYPO3 CMS Extbase Object Container Container $objectContainer
 

Detailed Description

Implementation of the default Extbase Object Manager

@template T

Definition at line 24 of file ObjectManager.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Extbase\Object\ObjectManager::__construct ( )

Constructs a new Object Manager

Definition at line 33 of file ObjectManager.php.

Referenced by TYPO3\CMS\Extbase\Object\ObjectManager\__wakeup().

Member Function Documentation

◆ __sleep()

array TYPO3\CMS\Extbase\Object\ObjectManager::__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

only to be used within Extbase, not part of TYPO3 Core API.

Definition at line 52 of file ObjectManager.php.

◆ __wakeup()

TYPO3\CMS\Extbase\Object\ObjectManager::__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

only to be used within Extbase, not part of TYPO3 Core API.

Definition at line 70 of file ObjectManager.php.

References TYPO3\CMS\Extbase\Object\ObjectManager\__construct().

◆ get()

◆ getEmptyObject()

object& T TYPO3\CMS\Extbase\Object\ObjectManager::getEmptyObject (   $className)

Create an instance of $className without calling its constructor

Parameters
string|class-string<T>‪$className
Returns
‪object&T

Implements TYPO3\CMS\Extbase\Object\ObjectManagerInterface.

Definition at line 125 of file ObjectManager.php.

◆ getScope()

int TYPO3\CMS\Extbase\Object\ObjectManager::getScope (   $objectName)

Returns the scope of the specified object.

Parameters
string$objectName‪The object name
Returns
‪int One of the Container::SCOPE_ constants
Exceptions

Implements TYPO3\CMS\Extbase\Object\ObjectManagerInterface.

Definition at line 111 of file ObjectManager.php.

References TYPO3\CMS\Extbase\Object\ObjectManager\isRegistered(), TYPO3\CMS\Extbase\Object\Container\Container\SCOPE_PROTOTYPE, and TYPO3\CMS\Extbase\Object\Container\Container\SCOPE_SINGLETON.

◆ isRegistered()

bool TYPO3\CMS\Extbase\Object\ObjectManager::isRegistered (   $objectName)

Returns TRUE if an object with the given name is registered

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

only to be used within Extbase, not part of TYPO3 Core API.

Implements TYPO3\CMS\Extbase\Object\ObjectManagerInterface.

Definition at line 82 of file ObjectManager.php.

Referenced by TYPO3\CMS\Extbase\Object\ObjectManager\getScope().

Member Data Documentation

◆ $objectContainer

TYPO3 CMS Extbase Object Container Container TYPO3\CMS\Extbase\Object\ObjectManager::$objectContainer
protected

Definition at line 28 of file ObjectManager.php.