Skip to content

Commit 2d31d34

Browse files
committed
Deprecate Configuration::(get|set)ProxyDir
1 parent 718826c commit 2d31d34

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/Configuration.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,8 @@ public function setMetadataCache(CacheItemPoolInterface $cache): void
316316

317317
/**
318318
* Sets the directory where Doctrine generates any necessary proxy class files.
319+
*
320+
* @deprecated Since 2.16, proxy directory is no longer used when native lazy objects are enabled.
319321
*/
320322
public function setProxyDir(string $dir): void
321323
{
@@ -325,9 +327,15 @@ public function setProxyDir(string $dir): void
325327

326328
/**
327329
* Gets the directory where Doctrine generates any necessary proxy class files.
330+
*
331+
* @deprecated Since 2.16, proxy directory is no longer used when native lazy objects are enabled.
328332
*/
329333
public function getProxyDir(): ?string
330334
{
335+
if ($this->isNativeLazyObjectEnabled()) {
336+
trigger_deprecation('doctrine/mongodb-odm', '2.16', 'Using "%s" is deprecated when native lazy objects are enabled.', __METHOD__);
337+
}
338+
331339
return $this->attributes['proxyDir'] ?? null;
332340
}
333341

0 commit comments

Comments
 (0)