Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-2394

QueryExpressionVisitor has no implementation of Comparison::CONTAINS

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Invalid
    • Affects Version/s: Git Master
    • Fix Version/s: None
    • Component/s: ORM
    • Environment:
      n/a

      Description

      Use case
      $criteria = Criteria::create();
      $criteria
          ->andWhere(
              $criteria->expr()->contains('r.body', 'foo')
          )
      ;
      
      $entities = $repo->createQueryBuilder()->addCriteria($criteria)->getQuery()->getResult();
      

      Throws the following exception:

      RuntimeException: Unknown comparison operator: CONTAINS

      I except it to properly handle the CONTAINS comparison and result in a LIKE operator.

      -------

      I added a failing test case & a fix there: https://github.com/borisguery/doctrine2/tree/DDC-2394

        Activity

        Hide
        Benjamin Eberlei added a comment -

        This was added in 2.4, you are probably using Collections 1.1 with ORM 2.3, where this occurs.

        Show
        Benjamin Eberlei added a comment - This was added in 2.4, you are probably using Collections 1.1 with ORM 2.3, where this occurs.
        Hide
        Matthieu Napoli added a comment -

        Apparently it wasn't, I'm on 2.4 and still get the exception.

        I submitted a PR: https://github.com/doctrine/doctrine2/pull/791

        Show
        Matthieu Napoli added a comment - Apparently it wasn't, I'm on 2.4 and still get the exception. I submitted a PR: https://github.com/doctrine/doctrine2/pull/791
        Hide
        Doctrine Bot added a comment -

        A related Github Pull-Request [GH-791] was closed:
        https://github.com/doctrine/doctrine2/pull/791

        Show
        Doctrine Bot added a comment - A related Github Pull-Request [GH-791] was closed: https://github.com/doctrine/doctrine2/pull/791

          People

          • Assignee:
            Benjamin Eberlei
            Reporter:
            Boris Guéry
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: