ObjectManager implements ObjectManagerInterface
Implementation of the default Extbase Object Manager
since v11, will be removed in v12. Use symfony DI and GeneralUtility::makeInstance() instead. See TYPO3 explained documentation for more information.
Table of Contents
Interfaces
- ObjectManagerInterface
- Interface for the TYPO3 Object Manager
Properties
Methods
- __construct() : mixed
- Constructs a new Object Manager
- __sleep() : array<string|int, mixed>
- Serialization (sleep) helper.
- __wakeup() : mixed
- Unserialization (wakeup) helper.
- get() : T
- Returns a fresh or existing instance of the class specified by $className.
- getEmptyObject() : T
- Creates an instance of $className without calling its constructor.
Properties
$objectContainer
protected
Container
$objectContainer
Methods
__construct()
Constructs a new Object Manager
public
__construct(ContainerInterface $container, Container $objectContainer) : mixed
Parameters
- $container : ContainerInterface
- $objectContainer : Container
__sleep()
Serialization (sleep) helper.
public
__sleep() : array<string|int, mixed>
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.
only to be used within Extbase, not part of TYPO3 Core API.
Tags
Return values
array<string|int, mixed> —Names of the properties to be serialized
__wakeup()
Unserialization (wakeup) helper.
public
__wakeup() : mixed
Initializes the properties again that have been removed by a call to the __sleep() method on serialization before.
only to be used within Extbase, not part of TYPO3 Core API.
Tags
get()
Returns a fresh or existing instance of the class specified by $className.
public
get(T> $className, array<string|int, mixed> ...$constructorArguments) : T
since TYPO3 10.4, will be removed in version 12.0
Parameters
- $className : T>
-
the name of the class to return an instance of
- $constructorArguments : array<string|int, mixed>
Tags
Return values
T —the class instance
getEmptyObject()
Creates an instance of $className without calling its constructor.
public
getEmptyObject(T> $className) : T
since v11, will be removed in v12. Does NOT log, has a v11 deprecation.rst file. Used in DataMapper, will be removed as breaking change in v12. Also drop doctrine/instantiator.
Parameters
- $className : T>
-
the name of the class to return an instance of
Tags
Return values
T —the class instance