Doctrine 1
  1. Doctrine 1
  2. DC-280

Add pre/postHydrateResultSet() events


    • Type: New Feature New Feature
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Connection, Query, Record
    • Labels:


      Over the last several weeks I've been working on streamlining the access control logic in the application I'm working on, and I realized that Doctrine's event listeners might be able to help. For more detailed background information take a look at ...but here's the problem in a nutshell:

      Since my application's access control logic is all implemented in PHP rather than in the database (i.e., I can't add access control to my queries as a simple WHERE clause), I'm looking for a way to hook into the query process just after the records have been hydrated and actually modify the result set that gets returned, such that only permissible records show up in the final result set.

      Unfortunately, although there are several listener methods that look promising for this, none of them seem to have access to the data being returned. For instance, if I run a custom query via Doctrine_Query::execute(), the postQuery() hook definitely runs ...but it doesn't give me access to anything but the query string itself.

      Since, in some instances (e.g., hydration listeners), the Doctrine_Event object is assigned arbitrary data that the listener can modify, I'm wondering if the same thing couldn't be done more universally?


        Adam Jensen created issue -
        Jonathan H. Wage made changes -
        Field Original Value New Value
        Summary Event and record listeners should be able to modify result sets Add pre/postHydrateResultSet() events
        Affects Version/s 1.2.0-BETA3 [ 10040 ]
        Issue Type Improvement [ 4 ] New Feature [ 2 ]
        Fix Version/s 1.3.0 [ 10042 ]
        Jonathan H. Wage made changes -
        Fix Version/s 1.2.2 [ 10047 ]
        Fix Version/s 1.3.0 [ 10042 ]
        Jonathan H. Wage made changes -
        Fix Version/s 1.2.3 [ 10051 ]
        Fix Version/s 1.2.2 [ 10047 ]
        Jonathan H. Wage made changes -
        Fix Version/s 1.2.3 [ 10051 ]


          • Assignee:
            Jonathan H. Wage
            Adam Jensen
          • Votes:
            0 Vote for this issue
            1 Start watching this issue


            • Created: