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

          People

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

            Dates

            • Created:
              Updated:
              Resolved: