Completed
Push — master ( 0cfd9b...0455f1 )
by André
27:37
created

UpdateContentMetadata::receive()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 12
Code Lines 7

Duplication

Lines 12
Ratio 100 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 7
c 1
b 0
f 0
nc 2
nop 1
dl 12
loc 12
rs 9.4285
1
<?php
2
3
/**
4
 * This file is part of the eZ Publish Kernel package.
5
 *
6
 * @copyright Copyright (C) eZ Systems AS. All rights reserved.
7
 * @license For full copyright and license information view LICENSE file distributed with this source code.
8
 */
9
namespace eZ\Publish\Core\Search\Common\Slot;
10
11
use eZ\Publish\Core\Search\Common\Slot;
12
use eZ\Publish\Core\SignalSlot\Signal;
13
14 View Code Duplication
class UpdateContentMetadata extends Slot
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
15
{
16
    /**
17
     * Receive the given $signal and react on it.
18
     *
19
     * @param Signal $signal
20
     */
21
    public function receive(Signal $signal)
22
    {
23
        if (!$signal instanceof Signal\ContentService\UpdateContentMetadataSignal) {
24
            return;
25
        }
26
27
        $contentInfo = $this->persistenceHandler->contentHandler()->loadContentInfo($signal->contentId);
28
        $this->searchHandler->indexContent(
29
            $this->persistenceHandler->contentHandler()->load($contentInfo->id, $contentInfo->currentVersionNo)
30
        );
31
        $this->searchHandler->indexLocation($this->persistenceHandler->locationHandler()->load($contentInfo->mainLocationId));
32
    }
33
}
34