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

Public Member Functions

object &T get (string $className,... $constructorArguments)
 
object &T getEmptyObject (string $className)
 

Detailed Description

Interface for the TYPO3 Object Manager

Definition at line 25 of file ObjectManagerInterface.php.

Member Function Documentation

◆ get()

object& T TYPO3\CMS\Extbase\Object\ObjectManagerInterface::get ( string  $className,
  $constructorArguments 
)

Returns a fresh or existing instance of the class specified by $className.

@template T

Parameters
class-string<T>‪$className the name of the class to return an instance of
array‪...$constructorArguments
Returns
‪object&T the class instance
Deprecated:
‪since TYPO3 10.4, will be removed in version 12.0

Implemented in TYPO3\CMS\Extbase\Object\ObjectManager.

Referenced by TYPO3\CMS\Extbase\Persistence\Generic\QueryResult\__wakeup(), TYPO3\CMS\Fluid\Core\ViewHelper\ViewHelperResolver\createViewHelperInstanceFromClassName(), TYPO3\CMS\Fluid\Core\Widget\AbstractWidgetViewHelper\injectObjectManager(), TYPO3\CMS\Extbase\Mvc\Controller\AbstractController\injectObjectManager(), and TYPO3\CMS\Extbase\Mvc\Controller\ActionController\injectObjectManager().

◆ getEmptyObject()

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

Creates an instance of $className without calling its constructor.

@template T

Parameters
class-string<T>‪$className the name of the class to return an instance of
Returns
‪object&T the class instance

Implemented in TYPO3\CMS\Extbase\Object\ObjectManager.