Completed
Push — ezp-30616-follow-up ( de1597...f1c1e1 )
by
unknown
14:34
created

AddRelationEvent   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 36
rs 10
c 0
b 0
f 0
wmc 4
lcom 0
cbo 1

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 9 1
A getRelation() 0 4 1
A getSourceVersion() 0 4 1
A getDestinationContent() 0 4 1
1
<?php
2
3
/**
4
 * @copyright Copyright (C) eZ Systems AS. All rights reserved.
5
 * @license For full copyright and license information view LICENSE file distributed with this source code.
6
 */
7
declare(strict_types=1);
8
9
namespace eZ\Publish\API\Repository\Events\Content;
10
11
use eZ\Publish\API\Repository\Values\Content\ContentInfo;
12
use eZ\Publish\API\Repository\Values\Content\Relation;
13
use eZ\Publish\API\Repository\Values\Content\VersionInfo;
14
use eZ\Publish\SPI\Repository\Event\AfterEvent;
15
16
final class AddRelationEvent extends AfterEvent
17
{
18
    /** @var \eZ\Publish\API\Repository\Values\Content\Relation */
19
    private $relation;
20
21
    /** @var \eZ\Publish\API\Repository\Values\Content\VersionInfo */
22
    private $sourceVersion;
23
24
    /** @var \eZ\Publish\API\Repository\Values\Content\ContentInfo */
25
    private $destinationContent;
26
27
    public function __construct(
28
        Relation $relation,
29
        VersionInfo $sourceVersion,
30
        ContentInfo $destinationContent
31
    ) {
32
        $this->relation = $relation;
33
        $this->sourceVersion = $sourceVersion;
34
        $this->destinationContent = $destinationContent;
35
    }
36
37
    public function getRelation(): Relation
38
    {
39
        return $this->relation;
40
    }
41
42
    public function getSourceVersion(): VersionInfo
43
    {
44
        return $this->sourceVersion;
45
    }
46
47
    public function getDestinationContent(): ContentInfo
48
    {
49
        return $this->destinationContent;
50
    }
51
}
52