|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace Proxies\__CG__\Hautelook\AliceBundle\Tests\SymfonyApp\TestBundle\Entity; |
|
4
|
|
|
|
|
5
|
|
|
/** |
|
6
|
|
|
* DO NOT EDIT THIS FILE - IT WAS CREATED BY DOCTRINE'S PROXY GENERATOR |
|
7
|
|
|
*/ |
|
8
|
|
View Code Duplication |
class Inte extends \Hautelook\AliceBundle\Tests\SymfonyApp\TestBundle\Entity\Inte implements \Doctrine\ORM\Proxy\Proxy |
|
|
|
|
|
|
9
|
|
|
{ |
|
10
|
|
|
/** |
|
11
|
|
|
* @var \Closure the callback responsible for loading properties in the proxy object. This callback is called with |
|
12
|
|
|
* three parameters, being respectively the proxy object to be initialized, the method that triggered the |
|
13
|
|
|
* initialization process and an array of ordered parameters that were passed to that method. |
|
14
|
|
|
* |
|
15
|
|
|
* @see \Doctrine\Common\Persistence\Proxy::__setInitializer |
|
16
|
|
|
*/ |
|
17
|
|
|
public $__initializer__; |
|
18
|
|
|
|
|
19
|
|
|
/** |
|
20
|
|
|
* @var \Closure the callback responsible of loading properties that need to be copied in the cloned object |
|
21
|
|
|
* |
|
22
|
|
|
* @see \Doctrine\Common\Persistence\Proxy::__setCloner |
|
23
|
|
|
*/ |
|
24
|
|
|
public $__cloner__; |
|
25
|
|
|
|
|
26
|
|
|
/** |
|
27
|
|
|
* @var boolean flag indicating if this object was already initialized |
|
28
|
|
|
* |
|
29
|
|
|
* @see \Doctrine\Common\Persistence\Proxy::__isInitialized |
|
30
|
|
|
*/ |
|
31
|
|
|
public $__isInitialized__ = false; |
|
32
|
|
|
|
|
33
|
|
|
/** |
|
34
|
|
|
* @var array properties to be lazy loaded, with keys being the property |
|
35
|
|
|
* names and values being their default values |
|
36
|
|
|
* |
|
37
|
|
|
* @see \Doctrine\Common\Persistence\Proxy::__getLazyProperties |
|
38
|
|
|
*/ |
|
39
|
|
|
public static $lazyPropertiesDefaults = []; |
|
40
|
|
|
|
|
41
|
|
|
|
|
42
|
|
|
|
|
43
|
|
|
/** |
|
44
|
|
|
* @param \Closure $initializer |
|
45
|
|
|
* @param \Closure $cloner |
|
46
|
|
|
*/ |
|
47
|
|
|
public function __construct($initializer = null, $cloner = null) |
|
48
|
|
|
{ |
|
49
|
|
|
|
|
50
|
|
|
$this->__initializer__ = $initializer; |
|
51
|
|
|
$this->__cloner__ = $cloner; |
|
52
|
|
|
} |
|
53
|
|
|
|
|
54
|
|
|
|
|
55
|
|
|
|
|
56
|
|
|
|
|
57
|
|
|
|
|
58
|
|
|
|
|
59
|
|
|
|
|
60
|
|
|
/** |
|
61
|
|
|
* |
|
62
|
|
|
* @return array |
|
63
|
|
|
*/ |
|
64
|
|
|
public function __sleep() |
|
65
|
|
|
{ |
|
66
|
|
|
if ($this->__isInitialized__) { |
|
67
|
|
|
return ['__isInitialized__', 'id']; |
|
68
|
|
|
} |
|
69
|
|
|
|
|
70
|
|
|
return ['__isInitialized__', 'id']; |
|
71
|
|
|
} |
|
72
|
|
|
|
|
73
|
|
|
/** |
|
74
|
|
|
* |
|
75
|
|
|
*/ |
|
76
|
|
|
public function __wakeup() |
|
77
|
|
|
{ |
|
78
|
|
|
if ( ! $this->__isInitialized__) { |
|
79
|
|
|
$this->__initializer__ = function (Inte $proxy) { |
|
80
|
|
|
$proxy->__setInitializer(null); |
|
81
|
|
|
$proxy->__setCloner(null); |
|
82
|
|
|
|
|
83
|
|
|
$existingProperties = get_object_vars($proxy); |
|
84
|
|
|
|
|
85
|
|
|
foreach ($proxy->__getLazyProperties() as $property => $defaultValue) { |
|
86
|
|
|
if ( ! array_key_exists($property, $existingProperties)) { |
|
87
|
|
|
$proxy->$property = $defaultValue; |
|
88
|
|
|
} |
|
89
|
|
|
} |
|
90
|
|
|
}; |
|
91
|
|
|
|
|
92
|
|
|
} |
|
93
|
|
|
} |
|
94
|
|
|
|
|
95
|
|
|
/** |
|
96
|
|
|
* |
|
97
|
|
|
*/ |
|
98
|
|
|
public function __clone() |
|
99
|
|
|
{ |
|
100
|
|
|
$this->__cloner__ && $this->__cloner__->__invoke($this, '__clone', []); |
|
101
|
|
|
} |
|
102
|
|
|
|
|
103
|
|
|
/** |
|
104
|
|
|
* Forces initialization of the proxy |
|
105
|
|
|
*/ |
|
106
|
|
|
public function __load() |
|
107
|
|
|
{ |
|
108
|
|
|
$this->__initializer__ && $this->__initializer__->__invoke($this, '__load', []); |
|
109
|
|
|
} |
|
110
|
|
|
|
|
111
|
|
|
/** |
|
112
|
|
|
* {@inheritDoc} |
|
113
|
|
|
* @internal generated method: use only when explicitly handling proxy specific loading logic |
|
114
|
|
|
*/ |
|
115
|
|
|
public function __isInitialized() |
|
116
|
|
|
{ |
|
117
|
|
|
return $this->__isInitialized__; |
|
118
|
|
|
} |
|
119
|
|
|
|
|
120
|
|
|
/** |
|
121
|
|
|
* {@inheritDoc} |
|
122
|
|
|
* @internal generated method: use only when explicitly handling proxy specific loading logic |
|
123
|
|
|
*/ |
|
124
|
|
|
public function __setInitialized($initialized) |
|
125
|
|
|
{ |
|
126
|
|
|
$this->__isInitialized__ = $initialized; |
|
127
|
|
|
} |
|
128
|
|
|
|
|
129
|
|
|
/** |
|
130
|
|
|
* {@inheritDoc} |
|
131
|
|
|
* @internal generated method: use only when explicitly handling proxy specific loading logic |
|
132
|
|
|
*/ |
|
133
|
|
|
public function __setInitializer(\Closure $initializer = null) |
|
134
|
|
|
{ |
|
135
|
|
|
$this->__initializer__ = $initializer; |
|
136
|
|
|
} |
|
137
|
|
|
|
|
138
|
|
|
/** |
|
139
|
|
|
* {@inheritDoc} |
|
140
|
|
|
* @internal generated method: use only when explicitly handling proxy specific loading logic |
|
141
|
|
|
*/ |
|
142
|
|
|
public function __getInitializer() |
|
143
|
|
|
{ |
|
144
|
|
|
return $this->__initializer__; |
|
145
|
|
|
} |
|
146
|
|
|
|
|
147
|
|
|
/** |
|
148
|
|
|
* {@inheritDoc} |
|
149
|
|
|
* @internal generated method: use only when explicitly handling proxy specific loading logic |
|
150
|
|
|
*/ |
|
151
|
|
|
public function __setCloner(\Closure $cloner = null) |
|
152
|
|
|
{ |
|
153
|
|
|
$this->__cloner__ = $cloner; |
|
154
|
|
|
} |
|
155
|
|
|
|
|
156
|
|
|
/** |
|
157
|
|
|
* {@inheritDoc} |
|
158
|
|
|
* @internal generated method: use only when explicitly handling proxy specific cloning logic |
|
159
|
|
|
*/ |
|
160
|
|
|
public function __getCloner() |
|
161
|
|
|
{ |
|
162
|
|
|
return $this->__cloner__; |
|
163
|
|
|
} |
|
164
|
|
|
|
|
165
|
|
|
/** |
|
166
|
|
|
* {@inheritDoc} |
|
167
|
|
|
* @internal generated method: use only when explicitly handling proxy specific loading logic |
|
168
|
|
|
* @static |
|
169
|
|
|
*/ |
|
170
|
|
|
public function __getLazyProperties() |
|
171
|
|
|
{ |
|
172
|
|
|
return self::$lazyPropertiesDefaults; |
|
173
|
|
|
} |
|
174
|
|
|
|
|
175
|
|
|
|
|
176
|
|
|
/** |
|
177
|
|
|
* {@inheritDoc} |
|
178
|
|
|
*/ |
|
179
|
|
|
public function getId() |
|
180
|
|
|
{ |
|
181
|
|
|
if ($this->__isInitialized__ === false) { |
|
182
|
|
|
return (int) parent::getId(); |
|
183
|
|
|
} |
|
184
|
|
|
|
|
185
|
|
|
|
|
186
|
|
|
$this->__initializer__ && $this->__initializer__->__invoke($this, 'getId', []); |
|
187
|
|
|
|
|
188
|
|
|
return parent::getId(); |
|
189
|
|
|
} |
|
190
|
|
|
|
|
191
|
|
|
} |
|
192
|
|
|
|
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.