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