Skip to content

Event reference

Ibexa DXP dispatches events during different actions. You can subscribe to these events to extend the functionality of the system.

In most cases, two events are dispatched for every action, one before the action is completed, and one after.

For example, copying a content item is connected with two events: BeforeCopyContentEvent and CopyContentEvent.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
<?php

namespace App\EventSubscriber;

use Ibexa\Contracts\Core\Repository\Events\Content\CopyContentEvent;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;

class MyEventSubscriber implements EventSubscriberInterface
{
    public static function getSubscribedEvents()
    {
        return [
            CopyContentEvent::class => ['onCopyContent', 0],
        ];
    }

    public function onCopyContent(CopyContentEvent $event): void
    {
        // your implementation
    }
}