Exponential 5.x Kernel 7.5.40 Exponential New Stack (Symfony-based) Kernel — PHP Class Reference

DeleteTranslation.php
Go to the documentation of this file.
1 <?php
2
7 namespace eZ\Publish\Core\Search\Common\Slot;
8
9 use eZ\Publish\Core\SignalSlot\Signal;
10 use eZ\Publish\Core\Search\Common\Slot;
11 use eZ\Publish\SPI\Search\ContentTranslationHandler;
12
16 class DeleteTranslation extends Slot
17 {
23 public function receive(Signal $signal)
24 {
25 if (!$signal instanceof Signal\ContentService\DeleteTranslationSignal) {
26 return;
27 }
28
29 $contentInfo = $this->persistenceHandler->contentHandler()->loadContentInfo(
30 $signal->contentId
31 );
32 if (!$contentInfo->isPublished) {
33 return;
34 }
35
36 if ($this->searchHandler instanceof ContentTranslationHandler) {
37 $this->searchHandler->deleteTranslation(
38 $contentInfo->id,
39 $signal->languageCode
40 );
41 }
42
43 $this->searchHandler->indexContent(
44 $this->persistenceHandler->contentHandler()->load(
45 $contentInfo->id,
46 $contentInfo->currentVersionNo
47 )
48 );
49
50 $locations = $this->persistenceHandler->locationHandler()->loadLocationsByContent(
51 $contentInfo->id
52 );
53 foreach ($locations as $location) {
54 $this->searchHandler->indexLocation($location);
55 }
56 }
57 }
eZ\Publish\Core\Search\Common\Slot\DeleteTranslation
A Search Engine slot handling DeleteTranslationSignal.
Definition: DeleteTranslation.php:17
eZ\Publish\Core\Search\Common\Slot\DeleteTranslation\receive
receive(Signal $signal)
Receive the given $signal and react on it.
Definition: DeleteTranslation.php:23
eZ\Publish\Core\Search\Common\Slot
General slot implementation for Search Engines.
Definition: Search/Common/Slot.php:18
eZ\Publish\Core\SignalSlot\Signal
Base class for Signals.
Definition: Signal.php:18
eZ\Publish\SPI\Search\ContentTranslationHandler
The Search Content translation handler.
Definition: ContentTranslationHandler.php:15
eZ\Publish\Core\Search\Common\Slot
Definition: AbstractSubtree.php:7
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.