1
|
|
|
<?php |
2
|
|
|
/** |
3
|
|
|
* Copyright (C) 2018 Gerrit Addiks. |
4
|
|
|
* This package (including this file) was released under the terms of the GPL-3.0. |
5
|
|
|
* You should have received a copy of the GNU General Public License along with this program. |
6
|
|
|
* If not, see <http://www.gnu.org/licenses/> or send me a mail so i can send you a copy. |
7
|
|
|
* |
8
|
|
|
* @license GPL-3.0 |
9
|
|
|
* |
10
|
|
|
* @author Gerrit Addiks <[email protected]> |
11
|
|
|
*/ |
12
|
|
|
|
13
|
|
|
namespace Addiks\RDMBundle\Mapping; |
14
|
|
|
|
15
|
|
|
use Addiks\RDMBundle\Mapping\MappingInterface; |
16
|
|
|
use Addiks\RDMBundle\Hydration\HydrationContextInterface; |
17
|
|
|
use Symfony\Component\DependencyInjection\ContainerInterface; |
18
|
|
|
|
19
|
|
|
final class MappingProxy implements MappingInterface |
20
|
|
|
{ |
21
|
|
|
|
22
|
|
|
/** |
23
|
|
|
* @var MappingInterface |
24
|
|
|
*/ |
25
|
|
|
private $innerMapping; |
26
|
|
|
|
27
|
|
|
/** |
28
|
|
|
* @var string |
29
|
|
|
*/ |
30
|
|
|
private $columnPrefix; |
31
|
|
|
|
32
|
7 |
|
public function __construct( |
33
|
|
|
MappingInterface $innerMapping, |
34
|
|
|
string $columnPrefix |
35
|
|
|
) { |
36
|
7 |
|
$this->innerMapping = $innerMapping; |
37
|
7 |
|
$this->columnPrefix = $columnPrefix; |
38
|
7 |
|
} |
39
|
|
|
|
40
|
1 |
|
public function describeOrigin(): string |
41
|
|
|
{ |
42
|
1 |
|
return $this->innerMapping->describeOrigin(); |
43
|
|
|
} |
44
|
|
|
|
45
|
1 |
|
public function collectDBALColumns(): array |
46
|
|
|
{ |
47
|
1 |
|
return $this->innerMapping->collectDBALColumns(); |
48
|
|
|
} |
49
|
|
|
|
50
|
1 |
|
public function resolveValue( |
51
|
|
|
HydrationContextInterface $context, |
52
|
|
|
array $dataFromAdditionalColumns |
53
|
|
|
) { |
54
|
1 |
|
return $this->innerMapping->resolveValue($context, $dataFromAdditionalColumns); |
55
|
|
|
} |
56
|
|
|
|
57
|
1 |
|
public function revertValue( |
58
|
|
|
HydrationContextInterface $context, |
59
|
|
|
$valueFromEntityField |
60
|
|
|
): array { |
61
|
1 |
|
return $this->innerMapping->revertValue($context, $valueFromEntityField); |
62
|
|
|
} |
63
|
|
|
|
64
|
1 |
|
public function assertValue( |
65
|
|
|
HydrationContextInterface $context, |
66
|
|
|
array $dataFromAdditionalColumns, |
67
|
|
|
$actualValue |
68
|
|
|
): void { |
69
|
1 |
|
$this->innerMapping->assertValue($context, $dataFromAdditionalColumns, $actualValue); |
70
|
1 |
|
} |
71
|
|
|
|
72
|
1 |
|
public function wakeUpMapping(ContainerInterface $container): void |
73
|
|
|
{ |
74
|
1 |
|
$this->innerMapping->wakeUpMapping($container); |
75
|
1 |
|
} |
76
|
|
|
|
77
|
|
|
} |
78
|
|
|
|