‪TYPO3CMS  9.5
TYPO3\CMS\Extbase\SignalSlot\Dispatcher Class Reference
Inheritance diagram for TYPO3\CMS\Extbase\SignalSlot\Dispatcher:
TYPO3\CMS\Core\SingletonInterface

Public Member Functions

 initializeObject ()
 
 connect ($signalClassName, $signalName, $slotClassNameOrObject, $slotMethodName='', $passSignalInformation=true)
 
mixed dispatch ($signalClassName, $signalName, array $signalArguments=[])
 
array getSlots ($signalClassName, $signalName)
 

Protected Attributes

bool $isInitialized = false
 
TYPO3 CMS Extbase Object ObjectManagerInterface $objectManager
 
array $slots = array( )
 
LoggerInterface $logger
 

Detailed Description

A dispatcher which dispatches signals by calling its registered slot methods and passing them the method arguments which were originally passed to the signal method.

Definition at line 27 of file Dispatcher.php.

Member Function Documentation

◆ connect()

TYPO3\CMS\Extbase\SignalSlot\Dispatcher::connect (   $signalClassName,
  $signalName,
  $slotClassNameOrObject,
  $slotMethodName = '',
  $passSignalInformation = true 
)

Connects a signal with a slot. One slot can be connected with multiple signals by calling this method multiple times.

Parameters
string$signalClassName‪Name of the class containing the signal
string$signalName‪Name of the signal
mixed$slotClassNameOrObject‪Name of the class containing the slot or the instantiated class or a Closure object
string$slotMethodName‪Name of the method to be used as a slot. If $slotClassNameOrObject is a Closure object, this parameter is ignored
bool$passSignalInformation‪If set to TRUE, the last argument passed to the slot will be information about the signal (EmitterClassName::signalName)
Exceptions

Definition at line 78 of file Dispatcher.php.

◆ dispatch()

mixed TYPO3\CMS\Extbase\SignalSlot\Dispatcher::dispatch (   $signalClassName,
  $signalName,
array  $signalArguments = [] 
)

Dispatches a signal by calling the registered Slot methods

Parameters
string$signalClassName‪Name of the class containing the signal
string$signalName‪Name of the signal
array$signalArguments‪arguments passed to the signal method
Returns
‪mixed
Exceptions
Exception

Definition at line 115 of file Dispatcher.php.

References TYPO3\CMS\Extbase\SignalSlot\Dispatcher\initializeObject().

Referenced by TYPO3\CMS\Impexp\Utility\ImportExportUtility\emitAfterImportExportInitialisationSignal(), TYPO3\CMS\Core\Imaging\IconFactory\emitBuildIconForResourceSignal(), TYPO3\CMS\Backend\Controller\EditDocumentController\emitFunctionAfterSignal(), TYPO3\CMS\Backend\Backend\ToolbarItems\SystemInformationToolbarItem\emitGetSystemInformation(), TYPO3\CMS\Extensionmanager\Service\ExtensionManagementService\emitHasInstalledExtensionSignal(), TYPO3\CMS\Backend\Backend\ToolbarItems\SystemInformationToolbarItem\emitLoadMessages(), TYPO3\CMS\Core\Resource\ResourceStorage\emitPostFileAddSignal(), TYPO3\CMS\Core\Resource\ResourceStorage\emitPostFileCopySignal(), TYPO3\CMS\Core\Resource\ResourceStorage\emitPostFileCreateSignal(), TYPO3\CMS\Core\Resource\ResourceStorage\emitPostFileDeleteSignal(), TYPO3\CMS\Core\Resource\ResourceStorage\emitPostFileMoveSignal(), TYPO3\CMS\Core\Resource\Service\FileProcessingService\emitPostFileProcessSignal(), TYPO3\CMS\Core\Resource\ResourceStorage\emitPostFileRenameSignal(), TYPO3\CMS\Core\Resource\ResourceStorage\emitPostFileReplaceSignal(), TYPO3\CMS\Core\Resource\ResourceStorage\emitPostFileSetContentsSignal(), TYPO3\CMS\Core\Resource\ResourceStorage\emitPostFolderAddSignal(), TYPO3\CMS\Core\Resource\ResourceStorage\emitPostFolderCopySignal(), TYPO3\CMS\Core\Resource\ResourceStorage\emitPostFolderDeleteSignal(), TYPO3\CMS\Core\Resource\ResourceStorage\emitPostFolderMoveSignal(), TYPO3\CMS\Core\Resource\ResourceStorage\emitPostFolderRenameSignal(), TYPO3\CMS\Core\Mail\Mailer\emitPostInitializeMailerSignal(), TYPO3\CMS\Core\Tree\TableConfiguration\DatabaseTreeDataProvider\emitPostProcessTreeDataSignal(), TYPO3\CMS\Core\Resource\ResourceStorage\emitPreFileAddSignal(), TYPO3\CMS\Core\Resource\ResourceStorage\emitPreFileCopySignal(), TYPO3\CMS\Core\Resource\ResourceStorage\emitPreFileCreateSignal(), TYPO3\CMS\Core\Resource\ResourceStorage\emitPreFileDeleteSignal(), TYPO3\CMS\Core\Resource\ResourceStorage\emitPreFileMoveSignal(), TYPO3\CMS\Core\Resource\Service\FileProcessingService\emitPreFileProcessSignal(), TYPO3\CMS\Core\Resource\ResourceStorage\emitPreFileRenameSignal(), TYPO3\CMS\Core\Resource\ResourceStorage\emitPreFileReplaceSignal(), TYPO3\CMS\Core\Resource\ResourceStorage\emitPreFileSetContentsSignal(), TYPO3\CMS\Core\Resource\ResourceStorage\emitPreFolderAddSignal(), TYPO3\CMS\Core\Resource\ResourceStorage\emitPreFolderCopySignal(), TYPO3\CMS\Core\Resource\ResourceStorage\emitPreFolderDeleteSignal(), TYPO3\CMS\Core\Resource\ResourceStorage\emitPreFolderMoveSignal(), TYPO3\CMS\Core\Resource\ResourceStorage\emitPreFolderRenameSignal(), TYPO3\CMS\Core\Resource\ResourceStorage\emitPreGeneratePublicUrlSignal(), TYPO3\CMS\Core\Resource\Index\MetaDataRepository\emitRecordCreatedSignal(), TYPO3\CMS\Core\Resource\Index\FileIndexRepository\emitRecordCreatedSignal(), TYPO3\CMS\Core\Resource\Index\MetaDataRepository\emitRecordDeletedSignal(), TYPO3\CMS\Core\Resource\Index\FileIndexRepository\emitRecordDeletedSignal(), TYPO3\CMS\Core\Resource\Index\FileIndexRepository\emitRecordMarkedAsMissingSignal(), TYPO3\CMS\Core\Resource\Index\MetaDataRepository\emitRecordPostRetrievalSignal(), TYPO3\CMS\Core\Resource\Index\MetaDataRepository\emitRecordUpdatedSignal(), TYPO3\CMS\Core\Resource\Index\FileIndexRepository\emitRecordUpdatedSignal(), TYPO3\CMS\Core\Resource\ResourceStorage\emitSanitizeFileNameSignal(), TYPO3\CMS\Core\Database\SoftReferenceIndex\emitSetTypoLinkPartsElement(), TYPO3\CMS\Workspaces\Service\GridDataService\emitSignal(), and TYPO3\CMS\Extensionmanager\Service\ExtensionManagementService\emitWillInstallExtensionsSignal().

◆ getSlots()

array TYPO3\CMS\Extbase\SignalSlot\Dispatcher::getSlots (   $signalClassName,
  $signalName 
)

Returns all slots which are connected with the given signal

Parameters
string$signalClassName‪Name of the class containing the signal
string$signalName‪Name of the signal
Returns
‪array An array of arrays with slot information

Definition at line 176 of file Dispatcher.php.

◆ initializeObject()

TYPO3\CMS\Extbase\SignalSlot\Dispatcher::initializeObject ( )

Initializes this object.

This methods needs to be used as alternative to inject aspects. Since this dispatches is used very early when the ObjectManager is not fully initialized (especially concerning caching framework), this is the only way.

Definition at line 57 of file Dispatcher.php.

Referenced by TYPO3\CMS\Extbase\SignalSlot\Dispatcher\dispatch().

Member Data Documentation

◆ $isInitialized

bool TYPO3\CMS\Extbase\SignalSlot\Dispatcher::$isInitialized = false
protected

Definition at line 31 of file Dispatcher.php.

◆ $logger

LoggerInterface TYPO3\CMS\Extbase\SignalSlot\Dispatcher::$logger
protected

Definition at line 47 of file Dispatcher.php.

◆ $objectManager

TYPO3 CMS Extbase Object ObjectManagerInterface TYPO3\CMS\Extbase\SignalSlot\Dispatcher::$objectManager
protected

Definition at line 35 of file Dispatcher.php.

◆ $slots

array TYPO3\CMS\Extbase\SignalSlot\Dispatcher::$slots = array( )
protected

Information about all slots connected a certain signal. Indexed by [$signalClassName][$signalMethodName] and then numeric with an array of information about the slot

Definition at line 43 of file Dispatcher.php.