Completed
Push — EZP-30427 ( f2742c...7c8d0e )
by
unknown
19:22
created

ContentDraftListItem::hasVersionInfo()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 0
dl 0
loc 4
rs 10
c 0
b 0
f 0
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\Values\Content\DraftList\Item;
10
11
use eZ\Publish\API\Repository\Values\Content\DraftList\ContentDraftListItemInterface;
12
use eZ\Publish\API\Repository\Values\Content\VersionInfo;
13
14
/**
15
 * Item of content drafts list.
16
 */
17
class ContentDraftListItem implements ContentDraftListItemInterface
18
{
19
    /** @var \eZ\Publish\API\Repository\Values\Content\VersionInfo */
20
    private $versionInfo;
21
22
    /**
23
     * @param $versionInfo
24
     */
25
    public function __construct(VersionInfo $versionInfo)
26
    {
27
        $this->versionInfo = $versionInfo;
28
    }
29
30
    /**
31
     * @return \eZ\Publish\API\Repository\Values\Content\VersionInfo|null
32
     */
33
    public function getVersionInfo(): ?VersionInfo
34
    {
35
        return $this->versionInfo;
36
    }
37
38
    /**
39
     * @return bool
40
     */
41
    public function hasVersionInfo(): bool
42
    {
43
        return $this->versionInfo instanceof VersionInfo;
44
    }
45
}
46