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

Events refactoring and support for modifying data in EventArgs #106

Merged
merged 3 commits into from
May 30, 2013

Conversation

jmikola
Copy link
Member

@jmikola jmikola commented Apr 30, 2013

This supersedes #98 and fixes #94.

public function __construct($invoker, $data = null, array $options = array())
{
parent::__construct($invoker, $data, $options);
$this->isDataChanged = false;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you could use private $isDataChanged = false, thus avoiding to overwrite the constructor.

@henrikbjorn
Copy link
Contributor

Cool exactly what i needed 👍

jmikola added 3 commits May 30, 2013 15:08
Both call patterns are supported in Database::createCollection(). CreateCollectionEventArgs is also modified, although the original methods are left in place and deprecated.
This adds options fields to events where appropriate, with a default value to preserve BC.
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
Copy link
Member Author

jmikola commented May 30, 2013

@stof: Thanks for the suggestion.

@henrikbjorn: Good to hear.

jmikola added a commit that referenced this pull request May 30, 2013
Events refactoring and support for modifying data in EventArgs
@jmikola jmikola merged commit 379852c into master May 30, 2013
@jmikola jmikola deleted the events branch May 30, 2013 19:10
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Events from Collection are not that useful.
3 participants