DDC-3016: Criterias do not work with embeddables when matching in memory #3746

Open
opened 2026-01-22 14:27:07 +01:00 by admin · 1 comment
Owner

Originally created by @doctrinebot on GitHub (Mar 7, 2014).

Originally assigned to: @beberlei on GitHub.

Jira issue originally created by user mnapoli:

When using criterias and doing the matching on a collection already loaded in memory, it will not work if filtering on embeddable objects.

Example:

    $criteria = new Criteria();
    $criteria->andWhere($criteria->expr()->eq('actions.view', true));

    $authorizations = $this->authorizations->matching($criteria);

Here the ClosureExpressionVisitor will try to get the property named ->actions.view instead of ->actions->view.

PHPUnit*Framework_Error*Notice : Undefined property: Tests\...\Model\ArticleAuthorization::$actions.view
Originally created by @doctrinebot on GitHub (Mar 7, 2014). Originally assigned to: @beberlei on GitHub. Jira issue originally created by user mnapoli: When using criterias and doing the matching on a collection already loaded in memory, it will not work if filtering on embeddable objects. Example: ``` $criteria = new Criteria(); $criteria->andWhere($criteria->expr()->eq('actions.view', true)); $authorizations = $this->authorizations->matching($criteria); ``` Here the ClosureExpressionVisitor will try to get the property named `->actions.view` instead of `->actions->view`. ``` PHPUnit*Framework_Error*Notice : Undefined property: Tests\...\Model\ArticleAuthorization::$actions.view ```
admin added the New Feature label 2026-01-22 14:27:07 +01:00
Author
Owner

@doctrinebot commented on GitHub (May 22, 2014):

Comment created by mnapoli:

I have opened a PR with a potential fix: https://github.com/doctrine/collections/pull/27

@doctrinebot commented on GitHub (May 22, 2014): Comment created by mnapoli: I have opened a PR with a potential fix: https://github.com/doctrine/collections/pull/27
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#3746