Completed
Push — lazy_api_properties ( 349d84 )
by André
70:22 queued 50:11
created

ContentInfoProxy   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
dl 0
loc 18
rs 10
c 0
b 0
f 0
wmc 2
lcom 1
cbo 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A getContentType() 0 8 2
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
namespace eZ\Publish\Core\Repository\Values\Content;
8
9
use eZ\Publish\API\Repository\Values\Content\ContentInfo as APIContentInfo;
10
use eZ\Publish\API\Repository\Values\ContentType\ContentType as APIContentType;
11
use eZ\Publish\Core\Repository\Values\GeneratorProxyTrait;
12
13
/**
14
 * This class represents a (lazy loaded) proxy for a content info value.
15
 *
16
 * @internal Meant for internal use by Repository, type hint against API object instead.
17
 */
18
class ContentInfoProxy extends APIContentInfo
19
{
20
    use GeneratorProxyTrait;
21
22
    /**
23
     * @var \eZ\Publish\API\Repository\Values\Content\ContentInfo|null
24
     */
25
    protected $object;
26
27
    public function getContentType() : APIContentType
28
    {
29
        if ($this->object === null) {
30
            $this->loadObject();
31
        }
32
33
        return $this->object->getContentType();
34
    }
35
}
36