[TYPO3-mvc] Signalslots: Problems trying to connect to afterUpdateObject signal

dhirth hirth at stimme.net
Thu Jan 16 11:21:13 CET 2014


Hello everyone,

I am trying to make TYPO3 call a custom function whenever a Record of a 
model of my extension is updated in the TYPO3-Backend. My approach was 
to use Signalslots, so i have the following code in ext_localconf.php:

/** @var \TYPO3\CMS\Extbase\SignalSlot\Dispatcher $signalSlotDispatcher */
$signalSlotDispatcher = 
\TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\SignalSlot\\Dispatcher');
$signalSlotDispatcher->connect(
     'TYPO3\\CMS\\Extbase\\Persistence\\Generic\\Backend',
     'afterUpdateObject',
     'VENDOR\\Extensionname\\Domain\\Service\\AlbumFactory',
     'updateTest'
);

The AlbumFactory class looks -in short - like this:

namespace VENDOR\Extensionname\Domain\Service;

class AlbumFactory implements \TYPO3\CMS\Core\SingletonInterface {
[...]

   /**
      * signalTest
      * @param  \TYPO3\CMS\Extbase\DomainObject\DomainObjectInterface 
$object
      * @return void
      */
     public function 
updateTest(\TYPO3\CMS\Extbase\DomainObject\DomainObjectInterface $object) {
         t3lib_div::debug($object);
         die("UPDATE! " . get_class($object));
     }

}

The Signal and my Slot function don't seem to connect, whenever I edit 
or create a record of the model (or of any model) in the db, the 
updateTest function doesn't seem to be called. What am i doing wrong? Am 
I missing something? Am I misunderstanding how these signals and 
signalslots work?

Thanks a lot and kind regards.
Daniel


More information about the TYPO3-project-typo3v4mvc mailing list