Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions UPGRADE-2.16.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# UPGRADE FROM 2.15 to 2.16

## Lazy Proxy Directory

Using proxy classes with PHP 8.4+ is deprecated, only native lazy objects will
be supported in MongoDB ODM 3.0.

Calling `Doctrine\ODM\MongoDB\Configuration::setProxyDir()` or
`Doctrine\ODM\MongoDB\Configuration::getProxyDir()` is deprecated and triggers
a deprecation notice when using native lazy objects.
8 changes: 8 additions & 0 deletions src/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,8 @@ public function setMetadataCache(CacheItemPoolInterface $cache): void

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

/**
* Gets the directory where Doctrine generates any necessary proxy class files.
*
* @deprecated Since 2.16, proxy directory is no longer used when native lazy objects are enabled.
*/
public function getProxyDir(): ?string
{
if ($this->isNativeLazyObjectEnabled()) {
trigger_deprecation('doctrine/mongodb-odm', '2.16', 'Using "%s" is deprecated when native lazy objects are enabled.', __METHOD__);
}

return $this->attributes['proxyDir'] ?? null;
}

Expand Down