Global navigation

   Documentation Center
   eZ Studio & eZ Platform
     User Manual
     Technical Manual
   eZ Publish 4.x / legacy

eZ Publish (5.x)

eZ Publish 5.x | For eZ Platform & eZ Studio topics see Technical manual and User manual, for eZ Publish 4.x and Legacy topics see eZ Publish legacy

Versions Compared


  • This line was added.
  • This line was removed.
  • Formatting was changed.
titleVersion compatibility

This recipe is compatible with eZ Publish 5.2 / 2013.07


Table of Contents




To learn more about SignalSlot in eZ Publish, please refer to the dedicated documentation page.

Signals reference

This recipe will describe how to register a Slot for a dedicated Signal.


Code Block
namespace Acme\TestBundle\Slot;
use eZ\Publish\Core\SignalSlot\Slot as BaseSlot;
use eZ\Publish\APICore\RepositorySignalSlot\RepositorySignal;
use eZ\Publish\SignalSlotAPI\SignalRepository\ContentService;
class OnPublishSlot extends BaseSlot
     * @var \eZ\Publish\API\Repository\ContentService
    private $contentService;

    public function __construct( ContentService $contentService )
        $this->contentService = $contentService;
    public function receive( Signal $signal )
        if ( !$signal instanceof Signal\ContentService\PublishVersionSignal )

        // Load published content
        $content = $this->contentService->loadContent( $signal->contentId, null, $signal->versionNo );
        // Do stuff with it...


eZ Publish comes with a generic slot that converts signals (including ones defined by user code) to regular event objects and expose them via the EventDispatcher. This makes it possible to implement a simple event listener/subscriber if you're more comfortable with this approach.