Skip to content

Commit 95a0442

Browse files
committed
Add a note that doctrine#472 may leave proxies uninitialized
1 parent 8bb3ad5 commit 95a0442

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

UPGRADE.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,16 @@ awareness about deprecated code.
1212

1313
Starting with the next major version, the only way to access data when using the criteria filtering
1414
API is through direct (reflection-based) access at properties directly, also bypassing property hooks.
15-
This is to ensure consistency with how the ORM/ODM work. See https://github.com/doctrine/collections/pull/472 for
15+
This is to ensure consistency with how the ORM/ODM works. See https://github.com/doctrine/collections/pull/472 for
1616
the full motivation.
1717

1818
To opt-in to the new behaviour, pass `true` for the `$accessRawFieldValues` parameter when creating a `Criteria`
19-
object through either `Doctrine\Common\Collections\Criteria::create()` or when calling the `Doctrine\Common\Collections\Criteria` constructor.
19+
object through either `Doctrine\Common\Collections\Criteria::create()` or when calling the `Doctrine\Common\Collections\Criteria` constructor.
20+
21+
Be aware that switching to reflection-based field access may prevent ORM or ODM proxy objects
22+
becoming initialized, since their triggers (like calling public methods) are bypassed. That might lead
23+
to `null` values being read from such objects, which may cause wrong filtering or sorting results.
24+
See https://github.com/doctrine/collections/issues/487 for more details on when this may happen.
2025

2126
# Upgrade to 2.2
2227

0 commit comments

Comments
 (0)