Doctrine 1
  1. Doctrine 1
  2. DC-1003

_processWhereIn does not allow the use of named query parameters

    Details

    • Type: Improvement Improvement
    • Status: Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Query
    • Labels:
      None
    • Environment:
      karmic, php 5.2.10, apache2

      Description

      When writing a query such as

      $query = $query->where('entity.myValue = :value', array(':value'=>5));

      you are unable to then

      $query = $query->whereIn('entity.otherValue', array(':otherValues'=>array(1,2,3)));

      Doctrine complains that you may not mix positional and named query parameters.

      The attached patch fixes this by checking if the key of the passed in parameter is non numeric and if so setting the "value" of the parameter place holder to the value of the key.

        Activity

        Hide
        alex pilon added a comment -

        I discovered an issue with the above patch. I am working on a better version.

        Show
        alex pilon added a comment - I discovered an issue with the above patch. I am working on a better version.
        Hide
        alex pilon added a comment -

        Here is a second version.. it is a little bit sloppy. Is there a resource I can find on here that will help me to improve code quality/unit test this?

        Show
        alex pilon added a comment - Here is a second version.. it is a little bit sloppy. Is there a resource I can find on here that will help me to improve code quality/unit test this?

          People

          • Assignee:
            Guilherme Blanco
            Reporter:
            alex pilon
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated: