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
:
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:
<?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