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