Completed
Push — ezp-30639-deprecated-view-acti... ( fa6552...a00a72 )
by
unknown
15:55
created

ProxyAwareDomainMapper   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A setProxyFactory() 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\Repository\Mapper;
10
11
use eZ\Publish\Core\Repository\ProxyFactory\ProxyDomainMapperInterface;
12
13
/**
14
 * @internal For internal use by Domain Mappers
15
 *
16
 * Common abstraction for domain mappers providing properties loaded via proxy.
17
 */
18
abstract class ProxyAwareDomainMapper
19
{
20
    /** @var \eZ\Publish\Core\Repository\ProxyFactory\ProxyDomainMapperInterface */
21
    protected $proxyFactory;
22
23
    public function __construct(?ProxyDomainMapperInterface $proxyFactory = null)
24
    {
25
        $this->proxyFactory = $proxyFactory;
26
    }
27
28
    /**
29
     * Setter for Proxy Factory to work around cyclic dependency issue on Repository.
30
     *
31
     * Note: to be resolved by Repository decoupling.
32
     */
33
    final public function setProxyFactory(ProxyDomainMapperInterface $proxyFactory): void
34
    {
35
        $this->proxyFactory = $proxyFactory;
36
    }
37
}
38