Completed
Push — master ( d82965...ddb300 )
by Christian
13s queued 11s
created

EncodingCompleteEvent::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 5
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 2
crap 1
1
<?php
2
3
/*
4
 * This file is part of the XabbuhPandaBundle package.
5
 *
6
 * (c) Christian Flothmann <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Xabbuh\PandaBundle\Event;
13
14
use Symfony\Contracts\EventDispatcher\Event;
15
16
/**
17
 * Event that is triggered when an encoding has successfully finished.
18
 *
19
 * @author Christian Flothmann <[email protected]>
20
 *
21
 * @final
22
 */
23
class EncodingCompleteEvent extends Event
24
{
25
    /**
26
     * The ENCODING_COMPLETE event occurs when an encoding is done or failed.
27
     *
28
     * The event listener method receives a Xabbuh\PandaBundle\Event\EncodingCompleteEvent instance.
29
     */
30
    const NAME = 'xabbuh_panda.encoding_complete';
31
32
    /**
33
     * The id of the encoded video
34
     * @var string
35
     */
36
    private $videoId;
37
38
    /**
39
     * The id of the encoding
40
     * @var string
41
     */
42
    private $encodingId;
43
44
    /**
45
     * Constructs a new EncodingCompleteEvent.
46
     *
47
     * @param string $videoId    Video id
48
     * @param string $encodingId Encoding id
49
     */
50 4
    public function __construct($videoId, $encodingId)
51
    {
52 4
        $this->videoId = $videoId;
53 4
        $this->encodingId = $encodingId;
54 4
    }
55
56
    /**
57
     * Returns the video id.
58
     *
59
     * @return string The video id
60
     */
61 3
    public function getVideoId()
62
    {
63 3
        return $this->videoId;
64
    }
65
66
    /**
67
     * Returns the encoding id.
68
     *
69
     * @return string The encoding id
70
     */
71 3
    public function getEncodingId()
72
    {
73 3
        return $this->encodingId;
74
    }
75
}
76