ReorderEvent::getAfter()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
/*
4
 * This file is part of Sulu.
5
 *
6
 * (c) MASSIVE ART WebServices GmbH
7
 *
8
 * This source file is subject to the MIT license that is bundled
9
 * with this source code in the file LICENSE.
10
 */
11
12
namespace Sulu\Component\DocumentManager\Event;
13
14
use PHPCR\NodeInterface;
15
16
class ReorderEvent extends AbstractMappingEvent
17
{
18
    /**
19
     * @var string
20
     */
21
    private $destId;
22
23
    /**
24
     * @var bool
25
     */
26
    private $after;
27
28
    /**
29
     * @param object $document
30
     * @param string $destId
31
     * @param bool $after
32
     */
33
    public function __construct($document, $destId, $after)
34
    {
35
        $this->document = $document;
36
        $this->destId = $destId;
37
        $this->after = $after;
38
    }
39
40
    /**
41
     * {@inheritdoc}
42
     */
43
    public function getDebugMessage()
44
    {
45
        return sprintf(
46
            '%s did:%s after:%s',
47
            parent::getDebugMessage(),
48
            $this->destId ?: '<no dest>',
49
            $this->after ? 'true' : 'false'
50
        );
51
    }
52
53
    /**
54
     * @return string
55
     */
56
    public function getDestId()
57
    {
58
        return $this->destId;
59
    }
60
61
    /**
62
     * @return bool
63
     */
64
    public function getAfter()
65
    {
66
        return $this->after;
67
    }
68
69
    /**
70
     * @param NodeInterface $node
71
     */
72
    public function setNode(NodeInterface $node)
73
    {
74
        $this->node = $node;
75
    }
76
}
77