Completed
Push — ezp-30616 ( 0a36b6 )
by
unknown
21:15 queued 06:15
created

CreateContentDraftEvent   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 56
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 56
rs 10
c 0
b 0
f 0
wmc 5
lcom 0
cbo 1

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 11 1
A getContentDraft() 0 4 1
A getContentInfo() 0 4 1
A getVersionInfo() 0 4 1
A getCreator() 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\Core\Event\Content;
10
11
use eZ\Publish\API\Repository\Values\Content\Content;
12
use eZ\Publish\API\Repository\Values\Content\ContentInfo;
13
use eZ\Publish\API\Repository\Values\Content\VersionInfo;
14
use eZ\Publish\API\Repository\Values\User\User;
15
use eZ\Publish\Core\Event\AfterEvent;
16
17
final class CreateContentDraftEvent extends AfterEvent
18
{
19
    public const NAME = 'ezplatform.event.content.draft_create';
20
21
    /**
22
     * @var \eZ\Publish\API\Repository\Values\Content\Content
23
     */
24
    private $contentDraft;
25
26
    /**
27
     * @var \eZ\Publish\API\Repository\Values\Content\ContentInfo
28
     */
29
    private $contentInfo;
30
31
    /**
32
     * @var \eZ\Publish\API\Repository\Values\Content\VersionInfo
33
     */
34
    private $versionInfo;
35
36
    /**
37
     * @var \eZ\Publish\API\Repository\Values\User\User
38
     */
39
    private $creator;
40
41
    public function __construct(
42
        Content $contentDraft,
43
        ContentInfo $contentInfo,
44
        VersionInfo $versionInfo,
45
        User $creator
46
    ) {
47
        $this->contentDraft = $contentDraft;
48
        $this->contentInfo = $contentInfo;
49
        $this->versionInfo = $versionInfo;
50
        $this->creator = $creator;
51
    }
52
53
    public function getContentDraft(): Content
54
    {
55
        return $this->contentDraft;
56
    }
57
58
    public function getContentInfo(): ContentInfo
59
    {
60
        return $this->contentInfo;
61
    }
62
63
    public function getVersionInfo(): VersionInfo
64
    {
65
        return $this->versionInfo;
66
    }
67
68
    public function getCreator(): User
69
    {
70
        return $this->creator;
71
    }
72
}
73