1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Doctrine\Persistence; |
4
|
|
|
|
5
|
|
|
use Doctrine\Persistence\Mapping\ClassMetadata; |
6
|
|
|
use Doctrine\Persistence\Mapping\ClassMetadataFactory; |
7
|
|
|
|
8
|
|
|
/** |
9
|
|
|
* Base class to simplify ObjectManager decorators |
10
|
|
|
*/ |
11
|
|
|
abstract class ObjectManagerDecorator implements ObjectManager |
12
|
|
|
{ |
13
|
|
|
/** @var ObjectManager */ |
14
|
|
|
protected $wrapped; |
15
|
|
|
|
16
|
|
|
/** |
17
|
|
|
* {@inheritdoc} |
18
|
|
|
*/ |
19
|
|
|
public function find(string $className, $id) : object |
20
|
|
|
{ |
21
|
|
|
return $this->wrapped->find($className, $id); |
|
|
|
|
22
|
|
|
} |
23
|
|
|
|
24
|
|
|
/** |
25
|
|
|
* {@inheritdoc} |
26
|
|
|
*/ |
27
|
|
|
public function persist(object $object) : void |
28
|
|
|
{ |
29
|
|
|
$this->wrapped->persist($object); |
30
|
|
|
} |
31
|
|
|
|
32
|
|
|
/** |
33
|
|
|
* {@inheritdoc} |
34
|
|
|
*/ |
35
|
|
|
public function remove(object $object) : void |
36
|
|
|
{ |
37
|
|
|
$this->wrapped->remove($object); |
38
|
|
|
} |
39
|
|
|
|
40
|
|
|
/** |
41
|
|
|
* {@inheritdoc} |
42
|
|
|
*/ |
43
|
|
|
public function merge(object $object) : object |
44
|
|
|
{ |
45
|
|
|
return $this->wrapped->merge($object); |
46
|
|
|
} |
47
|
|
|
|
48
|
|
|
/** |
49
|
|
|
* {@inheritdoc} |
50
|
|
|
*/ |
51
|
|
|
public function clear(?string $objectName = null) : void |
52
|
|
|
{ |
53
|
|
|
$this->wrapped->clear($objectName); |
54
|
|
|
} |
55
|
|
|
|
56
|
|
|
/** |
57
|
|
|
* {@inheritdoc} |
58
|
|
|
*/ |
59
|
|
|
public function detach(object $object) : void |
60
|
|
|
{ |
61
|
|
|
$this->wrapped->detach($object); |
62
|
|
|
} |
63
|
|
|
|
64
|
|
|
/** |
65
|
|
|
* {@inheritdoc} |
66
|
|
|
*/ |
67
|
|
|
public function refresh(object $object) : void |
68
|
|
|
{ |
69
|
|
|
$this->wrapped->refresh($object); |
70
|
|
|
} |
71
|
|
|
|
72
|
|
|
/** |
73
|
|
|
* {@inheritdoc} |
74
|
|
|
*/ |
75
|
|
|
public function flush() : void |
76
|
|
|
{ |
77
|
|
|
$this->wrapped->flush(); |
78
|
|
|
} |
79
|
|
|
|
80
|
|
|
/** |
81
|
|
|
* {@inheritdoc} |
82
|
|
|
*/ |
83
|
|
|
public function getRepository(string $className) : ObjectRepository |
84
|
|
|
{ |
85
|
|
|
return $this->wrapped->getRepository($className); |
86
|
|
|
} |
87
|
|
|
|
88
|
|
|
/** |
89
|
|
|
* {@inheritdoc} |
90
|
|
|
*/ |
91
|
|
|
public function getClassMetadata(string $className) : ClassMetadata |
92
|
|
|
{ |
93
|
|
|
return $this->wrapped->getClassMetadata($className); |
94
|
|
|
} |
95
|
|
|
|
96
|
|
|
/** |
97
|
|
|
* {@inheritdoc} |
98
|
|
|
*/ |
99
|
|
|
public function getMetadataFactory() : ClassMetadataFactory |
100
|
|
|
{ |
101
|
|
|
return $this->wrapped->getMetadataFactory(); |
102
|
|
|
} |
103
|
|
|
|
104
|
|
|
/** |
105
|
|
|
* {@inheritdoc} |
106
|
|
|
*/ |
107
|
|
|
public function initializeObject(object $obj) : void |
108
|
|
|
{ |
109
|
|
|
$this->wrapped->initializeObject($obj); |
110
|
|
|
} |
111
|
|
|
|
112
|
|
|
/** |
113
|
|
|
* {@inheritdoc} |
114
|
|
|
*/ |
115
|
|
|
public function contains(object $object) : bool |
116
|
|
|
{ |
117
|
|
|
return $this->wrapped->contains($object); |
118
|
|
|
} |
119
|
|
|
} |
120
|
|
|
|