AfterRecordPublishedEvent

New in version 12.2

The PSR-14 event \TYPO3\CMS\Workspaces\Event\AfterRecordPublishedEvent is fired after a record has been published in a workspace.

Example

Example

Registration of the event listener in the extension's Services.yaml:

EXT:my_extension/Configuration/Services.yaml
services:
  # Place here the default dependency injection configuration

  MyVendor\MyExtension\Workspaces\EventListener\MyEventListener:
    tags:
      - name: event.listener
        identifier: 'my-extension/after-record-published'
Copied!

Read how to configure dependency injection in extensions.

The corresponding event listener class:

EXT:my_extension/Classes/Workspaces/EventListener/MyEventListener.php
<?php

declare(strict_types=1);

namespace MyVendor\MyExtension\Workspaces\EventListener;

use TYPO3\CMS\Workspaces\Event\AfterRecordPublishedEvent;

final class MyEventListener
{
    public function __invoke(AfterRecordPublishedEvent $event): void
    {
        // Do your magic here
    }
}
Copied!

API

class \TYPO3\CMS\Workspaces\Event\ AfterRecordPublishedEvent

Event that is fired after a record has been published in a workspace.

getTable ( )

The table name of the record.

returntype

string

getRecordId ( )

The uid of the record

returntype

int

getWorkspaceId ( )

The workspace the record has been published in.

returntype

int