CommentEvent::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 7
ccs 6
cts 6
cp 1
rs 9.4285
cc 1
eloc 5
nc 1
nop 4
crap 1
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\Bundle\CommentBundle\Events;
13
14
use Sulu\Bundle\CommentBundle\Entity\CommentInterface;
15
use Sulu\Bundle\CommentBundle\Entity\ThreadInterface;
16
use Symfony\Component\EventDispatcher\Event;
17
18
/**
19
 * Event-arguments for comment events.
20
 */
21
class CommentEvent extends Event
22
{
23
    /**
24
     * @var string
25
     */
26
    private $type;
27
28
    /**
29
     * @var string
30
     */
31
    private $entityId;
32
33
    /**
34
     * @var CommentInterface
35
     */
36
    private $comment;
37
38
    /**
39
     * @var ThreadInterface
40
     */
41
    private $thread;
42
43
    /**
44
     * @param string $type
45
     * @param string $entityId
46
     * @param CommentInterface $comment
47
     * @param ThreadInterface $thread
48
     */
49 17
    public function __construct($type, $entityId, CommentInterface $comment, ThreadInterface $thread)
50
    {
51 17
        $this->type = $type;
52 17
        $this->entityId = $entityId;
53 17
        $this->comment = $comment;
54 17
        $this->thread = $thread;
55 17
    }
56
57
    /**
58
     * Returns type.
59
     *
60
     * @return string
61
     */
62
    public function getType()
63
    {
64
        return $this->type;
65
    }
66
67
    /**
68
     * Returns entity-id.
69
     *
70
     * @return string
71
     */
72
    public function getEntityId()
73
    {
74
        return $this->entityId;
75
    }
76
77
    /**
78
     * Returns comment.
79
     *
80
     * @return CommentInterface
81
     */
82 5
    public function getComment()
83
    {
84 5
        return $this->comment;
85
    }
86
87
    /**
88
     * Returns thread.
89
     *
90
     * @return ThreadInterface
91
     */
92
    public function getThread()
93
    {
94
        return $this->thread;
95
    }
96
}
97