-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Open
Description
Bug Report
With commit doctrine/collections#472, the OneToManyPersister class trigger deprecations.
| Q | A |
|---|---|
| Version | 3.5.2 |
Summary
The OneToManyPersister class use Criteria class without setting the $accessRawFieldValues parameter value to true.
Current behavior
In the count() function, a Criteria class is created without the $accessRawFieldValues parameter:
public function count(PersistentCollection $collection): int
{
//...
$criteria = new Criteria(Criteria::expr()->eq($mapping->mappedBy, $collection->getOwner()));
//...
}This is the same for the containsKey() and contains() functions.
Expected behavior
No deprecation must be raised.
public function count(PersistentCollection $collection): int
{
//...
$criteria = new Criteria(
expression: Criteria::expr()->eq($mapping->mappedBy, $collection->getOwner()),
accessRawFieldValues: true
);
//...
}Or use:
Criteria::create(true);How to reproduce
Just use a collection in an entity and call count() function.
Metadata
Metadata
Assignees
Labels
No labels