Skip to content
This repository has been archived by the owner on Nov 11, 2020. It is now read-only.

Events from Collection are not that useful. #94

Closed
henrikbjorn opened this issue Jan 26, 2013 · 2 comments · Fixed by #106
Closed

Events from Collection are not that useful. #94

henrikbjorn opened this issue Jan 26, 2013 · 2 comments · Fixed by #106

Comments

@henrikbjorn
Copy link
Contributor

The Events dispatched from a Collection like postFind and postFindOne are not that useful as you have no access to manipulate or change the data.

Reasoning as to why i would replace the data returned is that i am building a very simple way of having PDO::FECTH_OBJECT feature where the data i hydrated into an object. This is for fun and research but should still be possible.

Saying that i can just use the ODM is not a solution :)

@jmikola
Copy link
Member

jmikola commented Mar 7, 2013

If we look at the EventArgs class, the data (typically the query) is passed by reference. Wouldn't it be possible to assign the result of the getData() method by reference and modify that?

/ping @jwage as I haven't actually worked with this at all.

@henrikbjorn
Copy link
Contributor Author

@jmikola no it is not possible as i want to change the data to something else and not manipulate the original data :) Believe me i tried :)

jmikola added a commit that referenced this issue May 1, 2013
With the addition of FindEventArgs, find events will not receive the field projection in addition to the query. UpdateEventArgs now has options.

A new MutableEventArgs class was created to allow Collection query/command results to be modified by the post event listeners (as requested in #94).

Finally, CollectionEventsTest was created to test all pre/post events dispatched by Collection methods.
jmikola added a commit that referenced this issue May 1, 2013
With the addition of FindEventArgs, find events will not receive the field projection in addition to the query. UpdateEventArgs now has options.

A new MutableEventArgs class was created to allow Collection query/command results to be modified by the post event listeners (as requested in #94).

Finally, CollectionEventsTest was created to test all pre/post events dispatched by Collection methods.
jmikola added a commit that referenced this issue May 30, 2013
With the addition of FindEventArgs, find events will not receive the field projection in addition to the query. UpdateEventArgs now has options.

A new MutableEventArgs class was created to allow Collection query/command results to be modified by the post event listeners (as requested in #94).

Finally, CollectionEventsTest was created to test all pre/post events dispatched by Collection methods.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
2 participants