Skip to content

Commit 1e851ed

Browse files
authored
Merge pull request #55 from TomHAnderson/feature/upgrade-doctrine-orm-graphql
Upgrade to laravel-doctrine-orm 3.0.0
2 parents f43af4d + 1380cc9 commit 1e851ed

10 files changed

+261
-2365
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"api-skeletons/laravel-doctrine-apikey": "~2.0.2",
1111
"api-skeletons/laravel-doctrine-data-fixtures": "^1.0",
1212
"guzzlehttp/guzzle": "^7.2",
13-
"laravel-doctrine/orm": "^2.0",
13+
"laravel-doctrine/orm": "^3.0.0",
1414
"laravel/framework": "^10.0",
1515
"laravel/tinker": "^2.8",
1616
"mll-lab/laravel-graphiql": "^3.2"

composer.lock

Lines changed: 62 additions & 372 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

storage/proxies/__CG__ApiSkeletonsLaravelDoctrineApiKeyEntityAccessEvent.php

Lines changed: 26 additions & 260 deletions
Original file line numberDiff line numberDiff line change
@@ -2,282 +2,48 @@
22

33
namespace DoctrineProxies\__CG__\ApiSkeletons\Laravel\Doctrine\ApiKey\Entity;
44

5-
65
/**
76
* DO NOT EDIT THIS FILE - IT WAS CREATED BY DOCTRINE'S PROXY GENERATOR
87
*/
9-
class AccessEvent extends \ApiSkeletons\Laravel\Doctrine\ApiKey\Entity\AccessEvent implements \Doctrine\ORM\Proxy\Proxy
8+
class AccessEvent extends \ApiSkeletons\Laravel\Doctrine\ApiKey\Entity\AccessEvent implements \Doctrine\ORM\Proxy\InternalProxy
109
{
11-
/**
12-
* @var \Closure the callback responsible for loading properties in the proxy object. This callback is called with
13-
* three parameters, being respectively the proxy object to be initialized, the method that triggered the
14-
* initialization process and an array of ordered parameters that were passed to that method.
15-
*
16-
* @see \Doctrine\Common\Proxy\Proxy::__setInitializer
17-
*/
18-
public $__initializer__;
19-
20-
/**
21-
* @var \Closure the callback responsible of loading properties that need to be copied in the cloned object
22-
*
23-
* @see \Doctrine\Common\Proxy\Proxy::__setCloner
24-
*/
25-
public $__cloner__;
26-
27-
/**
28-
* @var boolean flag indicating if this object was already initialized
29-
*
30-
* @see \Doctrine\Persistence\Proxy::__isInitialized
31-
*/
32-
public $__isInitialized__ = false;
33-
34-
/**
35-
* @var array<string, null> properties to be lazy loaded, indexed by property name
36-
*/
37-
public static $lazyPropertiesNames = array (
38-
);
39-
40-
/**
41-
* @var array<string, mixed> default values of properties to be lazy loaded, with keys being the property names
42-
*
43-
* @see \Doctrine\Common\Proxy\Proxy::__getLazyProperties
44-
*/
45-
public static $lazyPropertiesDefaults = array (
46-
);
47-
48-
49-
50-
public function __construct(?\Closure $initializer = null, ?\Closure $cloner = null)
51-
{
52-
53-
$this->__initializer__ = $initializer;
54-
$this->__cloner__ = $cloner;
55-
}
56-
57-
58-
59-
60-
61-
62-
63-
/**
64-
*
65-
* @return array
66-
*/
67-
public function __sleep()
68-
{
69-
if ($this->__isInitialized__) {
70-
return ['__isInitialized__', '' . "\0" . 'ApiSkeletons\\Laravel\\Doctrine\\ApiKey\\Entity\\AccessEvent' . "\0" . 'ip_address', '' . "\0" . 'ApiSkeletons\\Laravel\\Doctrine\\ApiKey\\Entity\\AccessEvent' . "\0" . 'url', '' . "\0" . 'ApiSkeletons\\Laravel\\Doctrine\\ApiKey\\Entity\\AccessEvent' . "\0" . 'created_at', '' . "\0" . 'ApiSkeletons\\Laravel\\Doctrine\\ApiKey\\Entity\\AccessEvent' . "\0" . 'id', '' . "\0" . 'ApiSkeletons\\Laravel\\Doctrine\\ApiKey\\Entity\\AccessEvent' . "\0" . 'apiKey'];
71-
}
72-
73-
return ['__isInitialized__', '' . "\0" . 'ApiSkeletons\\Laravel\\Doctrine\\ApiKey\\Entity\\AccessEvent' . "\0" . 'ip_address', '' . "\0" . 'ApiSkeletons\\Laravel\\Doctrine\\ApiKey\\Entity\\AccessEvent' . "\0" . 'url', '' . "\0" . 'ApiSkeletons\\Laravel\\Doctrine\\ApiKey\\Entity\\AccessEvent' . "\0" . 'created_at', '' . "\0" . 'ApiSkeletons\\Laravel\\Doctrine\\ApiKey\\Entity\\AccessEvent' . "\0" . 'id', '' . "\0" . 'ApiSkeletons\\Laravel\\Doctrine\\ApiKey\\Entity\\AccessEvent' . "\0" . 'apiKey'];
74-
}
75-
76-
/**
77-
*
78-
*/
79-
public function __wakeup()
80-
{
81-
if ( ! $this->__isInitialized__) {
82-
$this->__initializer__ = function (AccessEvent $proxy) {
83-
$proxy->__setInitializer(null);
84-
$proxy->__setCloner(null);
85-
86-
$existingProperties = get_object_vars($proxy);
87-
88-
foreach ($proxy::$lazyPropertiesDefaults as $property => $defaultValue) {
89-
if ( ! array_key_exists($property, $existingProperties)) {
90-
$proxy->$property = $defaultValue;
91-
}
92-
}
93-
};
94-
95-
}
96-
}
97-
98-
/**
99-
*
100-
*/
101-
public function __clone()
102-
{
103-
$this->__cloner__ && $this->__cloner__->__invoke($this, '__clone', []);
10+
use \Symfony\Component\VarExporter\LazyGhostTrait {
11+
initializeLazyObject as private;
12+
setLazyObjectAsInitialized as public __setInitialized;
13+
isLazyObjectInitialized as private;
14+
createLazyGhost as private;
15+
resetLazyObject as private;
10416
}
10517

106-
/**
107-
* Forces initialization of the proxy
108-
*/
10918
public function __load(): void
11019
{
111-
$this->__initializer__ && $this->__initializer__->__invoke($this, '__load', []);
20+
$this->initializeLazyObject();
11221
}
113-
114-
/**
115-
* {@inheritDoc}
116-
* @internal generated method: use only when explicitly handling proxy specific loading logic
117-
*/
118-
public function __isInitialized(): bool
119-
{
120-
return $this->__isInitialized__;
121-
}
122-
123-
/**
124-
* {@inheritDoc}
125-
* @internal generated method: use only when explicitly handling proxy specific loading logic
126-
*/
127-
public function __setInitialized($initialized): void
128-
{
129-
$this->__isInitialized__ = $initialized;
130-
}
131-
132-
/**
133-
* {@inheritDoc}
134-
* @internal generated method: use only when explicitly handling proxy specific loading logic
135-
*/
136-
public function __setInitializer(?\Closure $initializer = null): void
137-
{
138-
$this->__initializer__ = $initializer;
139-
}
140-
141-
/**
142-
* {@inheritDoc}
143-
* @internal generated method: use only when explicitly handling proxy specific loading logic
144-
*/
145-
public function __getInitializer(): ?\Closure
146-
{
147-
return $this->__initializer__;
148-
}
149-
150-
/**
151-
* {@inheritDoc}
152-
* @internal generated method: use only when explicitly handling proxy specific loading logic
153-
*/
154-
public function __setCloner(?\Closure $cloner = null): void
155-
{
156-
$this->__cloner__ = $cloner;
157-
}
158-
159-
/**
160-
* {@inheritDoc}
161-
* @internal generated method: use only when explicitly handling proxy specific cloning logic
162-
*/
163-
public function __getCloner(): ?\Closure
164-
{
165-
return $this->__cloner__;
166-
}
167-
168-
/**
169-
* {@inheritDoc}
170-
* @internal generated method: use only when explicitly handling proxy specific loading logic
171-
* @deprecated no longer in use - generated code now relies on internal components rather than generated public API
172-
* @static
173-
*/
174-
public function __getLazyProperties(): array
175-
{
176-
return self::$lazyPropertiesDefaults;
177-
}
178-
17922

180-
/**
181-
* {@inheritDoc}
182-
*/
183-
public function setIpAddress($ipAddress)
184-
{
185-
186-
$this->__initializer__ && $this->__initializer__->__invoke($this, 'setIpAddress', [$ipAddress]);
187-
188-
return parent::setIpAddress($ipAddress);
189-
}
190-
191-
/**
192-
* {@inheritDoc}
193-
*/
194-
public function getIpAddress()
195-
{
19623

197-
$this->__initializer__ && $this->__initializer__->__invoke($this, 'getIpAddress', []);
24+
private const LAZY_OBJECT_PROPERTY_SCOPES = [
25+
"\0".parent::class."\0".'apiKey' => [parent::class, 'apiKey', null],
26+
"\0".parent::class."\0".'created_at' => [parent::class, 'created_at', null],
27+
"\0".parent::class."\0".'id' => [parent::class, 'id', null],
28+
"\0".parent::class."\0".'ip_address' => [parent::class, 'ip_address', null],
29+
"\0".parent::class."\0".'url' => [parent::class, 'url', null],
30+
'apiKey' => [parent::class, 'apiKey', null],
31+
'created_at' => [parent::class, 'created_at', null],
32+
'id' => [parent::class, 'id', null],
33+
'ip_address' => [parent::class, 'ip_address', null],
34+
'url' => [parent::class, 'url', null],
35+
];
19836

199-
return parent::getIpAddress();
200-
}
201-
202-
/**
203-
* {@inheritDoc}
204-
*/
205-
public function setUrl($url)
206-
{
207-
208-
$this->__initializer__ && $this->__initializer__->__invoke($this, 'setUrl', [$url]);
209-
210-
return parent::setUrl($url);
211-
}
212-
213-
/**
214-
* {@inheritDoc}
215-
*/
216-
public function getUrl()
217-
{
218-
219-
$this->__initializer__ && $this->__initializer__->__invoke($this, 'getUrl', []);
220-
221-
return parent::getUrl();
222-
}
223-
224-
/**
225-
* {@inheritDoc}
226-
*/
227-
public function setCreatedAt($createdAt)
228-
{
229-
230-
$this->__initializer__ && $this->__initializer__->__invoke($this, 'setCreatedAt', [$createdAt]);
231-
232-
return parent::setCreatedAt($createdAt);
233-
}
234-
235-
/**
236-
* {@inheritDoc}
237-
*/
238-
public function getCreatedAt()
239-
{
240-
241-
$this->__initializer__ && $this->__initializer__->__invoke($this, 'getCreatedAt', []);
242-
243-
return parent::getCreatedAt();
244-
}
245-
246-
/**
247-
* {@inheritDoc}
248-
*/
249-
public function getId()
250-
{
251-
if ($this->__isInitialized__ === false) {
252-
return parent::getId();
253-
}
254-
255-
256-
$this->__initializer__ && $this->__initializer__->__invoke($this, 'getId', []);
257-
258-
return parent::getId();
259-
}
260-
261-
/**
262-
* {@inheritDoc}
263-
*/
264-
public function setApiKey(\ApiSkeletons\Laravel\Doctrine\ApiKey\Entity\ApiKey $apiKey)
37+
public function __isInitialized(): bool
26538
{
266-
267-
$this->__initializer__ && $this->__initializer__->__invoke($this, 'setApiKey', [$apiKey]);
268-
269-
return parent::setApiKey($apiKey);
39+
return isset($this->lazyObjectState) && $this->isLazyObjectInitialized();
27040
}
27141

272-
/**
273-
* {@inheritDoc}
274-
*/
275-
public function getApiKey()
42+
public function __serialize(): array
27643
{
44+
$properties = (array) $this;
45+
unset($properties["\0" . self::class . "\0lazyObjectState"]);
27746

278-
$this->__initializer__ && $this->__initializer__->__invoke($this, 'getApiKey', []);
279-
280-
return parent::getApiKey();
47+
return $properties;
28148
}
282-
28349
}

0 commit comments

Comments
 (0)