Doctrine MongoDB ODM
  1. Doctrine MongoDB ODM
  2. MODM-178

Add an event that allows adjustment of a query prior to being executed

    Details

    • Type: New Feature New Feature
    • Status: Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Query Builder
    • Labels:
      None

      Description

      I would like to add an event which is triggered upon the creation of a query, and prior to the query being executed. This would allow the query to be modified prior to execution.

      This would be useful in the following use case (off the top of my head):

      1. A developer needs to set the scope of a query. An example would be: In a white-label site situation where you want to make sure the login only checks for the correct user in the scope of the domain. Rather than needing to make sure that every query has the scope added when the query is defined, the scope could be added prior to execution.
      2. Users want to enable encryption on certain fields. The encrypting and decrypting part are fairly straight-forward using the existing events. The problem is encountered when you have to be aware of the encryption when composing a query. If we could modify the query prior to execution, we could check the fields and adjust the search values as needed.

        Activity

        Hide
        Westin Pigott added a comment -

        BTW, if you point me in the general direction, I would be happy to do the work on this issue.

        Show
        Westin Pigott added a comment - BTW, if you point me in the general direction, I would be happy to do the work on this issue.

          People

          • Assignee:
            Jonathan H. Wage
            Reporter:
            Westin Pigott
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated: