Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-3016

Criterias do not work with embeddables when matching in memory

    Details

    • Type: New Feature New Feature
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Security Level: All
    • Labels:
      None

      Description

      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
      

        Activity

        Hide
        Matthieu Napoli added a comment -

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

        Show
        Matthieu Napoli added a comment - I have opened a PR with a potential fix: https://github.com/doctrine/collections/pull/27

          People

          • Assignee:
            Benjamin Eberlei
            Reporter:
            Matthieu Napoli
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated: