Classes/Utility/GeneralUtility.php
public static function callHookAndSignal($class, $name, $obj, &$args = null)
    {
        static $hookConf = null;
        static $signalSlotDispatcher = null;

        // Fetch hooks config for metaseo, minimize array lookups
        if ($hookConf === null) {
            $hookConf = array();
            if (isset($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['metaseo']['hooks'])
                && is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['metaseo']['hooks'])
            ) {
                $hookConf = $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['metaseo']['hooks'];
            }
        }

        // Call hooks
        if (!empty($hookConf[$name]) && is_array($hookConf[$name])) {
            foreach ($hookConf[$name] as $_funcRef) {
                if ($_funcRef) {
                    Typo3GeneralUtility::callUserFunction($_funcRef, $args, $obj);
                }
            }
        }

        // Call signal
        if ($signalSlotDispatcher === null) {
            /** @var \TYPO3\CMS\Extbase\Object\ObjectManager $objectManager */
            $objectManager = Typo3GeneralUtility::makeInstance(
                'TYPO3\\CMS\\Extbase\\Object\\ObjectManager'
            );

            /** @var \TYPO3\CMS\Extbase\SignalSlot\Dispatcher $signalSlotDispatcher */
            $signalSlotDispatcher = $objectManager->get('TYPO3\\CMS\\Extbase\\SignalSlot\\Dispatcher');
        }
        list($args) = $signalSlotDispatcher->dispatch($class, $name, array($args, $obj));
    }
public static function callHookAndSignal($class, $name, $obj, &$args = null)
    {
        static $hookConf = null;
        static $signalSlotDispatcher = null;

        // Fetch hooks config for metaseo, minimize array lookups
        if ($hookConf === null) {
            $hookConf = array();
            if (isset($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['metaseo']['hooks'])
                && is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['metaseo']['hooks'])
            ) {
                $hookConf = $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['metaseo']['hooks'];
            }
        }

        // Call hooks
        if (!empty($hookConf[$name]) && is_array($hookConf[$name])) {
            foreach ($hookConf[$name] as $_funcRef) {
                if ($_funcRef) {
                    Typo3GeneralUtility::callUserFunction($_funcRef, $args, $obj);
                }
            }
        }

        // Call signal
        if ($signalSlotDispatcher === null) {
            /** @var \TYPO3\CMS\Extbase\Object\ObjectManager $objectManager */
            $objectManager = Typo3GeneralUtility::makeInstance(
                'TYPO3\\CMS\\Extbase\\Object\\ObjectManager'
            );

            /** @var \TYPO3\CMS\Extbase\SignalSlot\Dispatcher $signalSlotDispatcher */
            $signalSlotDispatcher = $objectManager->get('TYPO3\\CMS\\Extbase\\SignalSlot\\Dispatcher');
        }
        list($args) = $signalSlotDispatcher->dispatch($class, $name, array($args, $obj));
    }
public static function callHookAndSignal ( $ class , $ name , $ obj , & $ args = null ) { static $ hookConf = null ; static $ signalSlotDispatcher = null ; // Fetch hooks config for metaseo, minimize array lookups if ( $ hookConf === null ) { $ hookConf = array ( ) ; if ( isset ( $ GLOBALS [ 'TYPO3_CONF_VARS' ] [ 'EXTCONF' ] [ 'metaseo' ] [ 'hooks' ] ) && is_array ( $ GLOBALS [ 'TYPO3_CONF_VARS' ] [ 'EXTCONF' ] [ 'metaseo' ] [ 'hooks' ] ) ) { $ hookConf = $ GLOBALS [ 'TYPO3_CONF_VARS' ] [ 'EXTCONF' ] [ 'metaseo' ] [ 'hooks' ] ; } } // Call hooks if ( ! empty ( $ hookConf [ $ name ] ) && is_array ( $ hookConf [ $ name ] ) ) { foreach ( $ hookConf [ $ name ] as $ _funcRef ) { if ( $ _funcRef ) { Typo3GeneralUtility :: callUserFunction ( $ _funcRef , $ args , $ obj ) ; } } } // Call signal if ( $ signalSlotDispatcher === null ) { /** @var \TYPO3\CMS\Extbase\Object\ObjectManager $objectManager */ $ objectManager = Typo3GeneralUtility :: makeInstance ( 'TYPO3\\CMS\\Extbase\\Object\\ObjectManager' ) ; /** @var \TYPO3\CMS\Extbase\SignalSlot\Dispatcher $signalSlotDispatcher */ $ signalSlotDispatcher = $ objectManager -> get ( 'TYPO3\\CMS\\Extbase\\SignalSlot\\Dispatcher' ) ; } list ( $ args ) = $ signalSlotDispatcher -> dispatch ( $ class , $ name , array ( $ args , $ obj ) ) ; }
Call hook and signal

@param   string     $class Name of the class containing the signal
@param   string     $name  Name of hook
@param   mixed $obj Reference to be passed along (typically "$this"
- being a reference to the calling object) (REFERENCE!)
@param   mixed|NULL $args  Args
Call hook and signal