<!-- 
RSS generated by JIRA (5.2.7#850-sha1:b2af0c8dc8537b36121c6a579fabbdf79fc919e5) at Wed May 22 06:04:14 UTC 2013

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary add field=key&field=summary to the URL of your request.
For example:
http://www.doctrine-project.org/jira/si/jira.issueviews:issue-xml/DC-280/DC-280.xml?field=key&field=summary
-->
<rss version="0.92" >
<channel>
    <title>Doctrine Project</title>
    <link>http://www.doctrine-project.org/jira</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>5.2.7</version>
        <build-number>850</build-number>
        <build-date>21-02-2013</build-date>
    </build-info>

<item>
            <title>[DC-280] Add pre/postHydrateResultSet() events</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-280</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Over the last several weeks I&apos;ve been working on streamlining the access control logic in the application I&apos;m working on, and I realized that Doctrine&apos;s event listeners might be able to help.  For more detailed background information take a look at &lt;a href=&quot;http://groups.google.com:80/group/dallasphp/browse_thread/thread/91e3f107cd611adf&quot; class=&quot;external-link&quot;&gt;http://groups.google.com:80/group/dallasphp/browse_thread/thread/91e3f107cd611adf&lt;/a&gt; ...but here&apos;s the problem in a nutshell:&lt;/p&gt;

&lt;p&gt;Since my application&apos;s access control logic is all implemented in PHP rather than in the database (i.e., I can&apos;t add access control to my queries as a simple WHERE clause), I&apos;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.&lt;/p&gt;

&lt;p&gt;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&apos;t give me access to anything but the query string itself.&lt;/p&gt;

&lt;p&gt;Since, in some instances (e.g., hydration listeners), the Doctrine_Event object is assigned arbitrary data that the listener can modify, I&apos;m wondering if the same thing couldn&apos;t be done more universally?&lt;/p&gt;</description>
                <environment></environment>
            <key id="10495">DC-280</key>
            <summary>Add pre/postHydrateResultSet() events</summary>
                <type id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/newfeature.png">New Feature</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="jazzslider">Adam Jensen</reporter>
                        <labels>
                    </labels>
                <created>Mon, 23 Nov 2009 23:38:02 +0000</created>
                <updated>Tue, 8 Jun 2010 16:09:38 +0000</updated>
                                                                    <component>Connection</component>
                <component>Query</component>
                <component>Record</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="10829" author="jwage" created="Tue, 24 Nov 2009 00:01:06 +0000"  >&lt;p&gt;In Doctrine 1.2 you can create custom hydrators. You can extend the core hydrators to remove the data you want? I think that would work.&lt;/p&gt;</comment>
                    <comment id="10846" author="jazzslider" created="Tue, 24 Nov 2009 19:45:06 +0000"  >&lt;p&gt;Sure enough, that does the trick!&lt;/p&gt;

&lt;p&gt;There are a couple of downsides, though, that might be worth considering in terms of future development:&lt;/p&gt;

&lt;p&gt;1. It would be nice to be able to specify constructor arguments for the hydrator, so that collaborators can be injected.  In my example, the hydrator needs access to the application&apos;s access control list object; currently it&apos;s simply retrieving it from a global registry, but it would be nice for testing&apos;s sake to be able to inject it instead.&lt;br/&gt;
2. It would also be nice to be able to chain multiple hydrators together; that&apos;s one reason I was looking at listeners, since they&apos;ve got that capability already.  That approach allows you to keep distinct behavior distinct a lot more easily.&lt;/p&gt;

&lt;p&gt;Ultimately, I&apos;d still kind of like to see another listener method available ...say, preHydrateResultSet() and postHydrateResultSet()?  I think that would be a more flexible approach, even though the custom hydrator solution works quite well.&lt;/p&gt;

&lt;p&gt;Thanks!&lt;br/&gt;
Adam&lt;/p&gt;</comment>
                    <comment id="10847" author="jwage" created="Tue, 24 Nov 2009 19:49:31 +0000"  >&lt;p&gt;I like the idea. I&apos;ll move this to 1.3. I don&apos;t think we&apos;re gonna have a 1.3 version but if we do, it&apos;ll be there.&lt;/p&gt;</comment>
                    <comment id="12211" author="jwage" created="Mon, 15 Mar 2010 14:22:57 +0000"  >&lt;p&gt;We can include this in a 1.2.x release if you would like to provide a patch and some tests. Thanks, Jon&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>
</channel>
</rss>