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

Note

Currently, we do not have an example for this event. If you can provide a useful one, please open an issue with your code snippets or a pull request.

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'

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
    }
}

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.

Return type

string

getRecordId()

The uid of the record

Return type

int

getWorkspaceId()

The workspace the record has been published in.

Return type

int