{"action":"created","issue":{"url":"https://api.github.com/repos/qandidate-labs/broadway/issues/188","labels_url":"https://api.github.com/repos/qandidate-labs/broadway/issues/188/labels{/name}","comments_url":"https://api.github.com/repos/qandidate-labs/broadway/issues/188/comments","events_url":"https://api.github.com/repos/qandidate-labs/broadway/issues/188/events","html_url":"https://github.com/qandidate-labs/broadway/pull/188","id":94646855,"number":188,"title":"Allow for event store management; query event store.","user":{"login":"simensen","id":191200,"avatar_url":"https://avatars.githubusercontent.com/u/191200?v=3","gravatar_id":"","url":"https://api.github.com/users/simensen","html_url":"https://github.com/simensen","followers_url":"https://api.github.com/users/simensen/followers","following_url":"https://api.github.com/users/simensen/following{/other_user}","gists_url":"https://api.github.com/users/simensen/gists{/gist_id}","starred_url":"https://api.github.com/users/simensen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/simensen/subscriptions","organizations_url":"https://api.github.com/users/simensen/orgs","repos_url":"https://api.github.com/users/simensen/repos","events_url":"https://api.github.com/users/simensen/events{/privacy}","received_events_url":"https://api.github.com/users/simensen/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":10,"created_at":"2015-07-13T06:01:45Z","updated_at":"2015-07-30T06:09:10Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/qandidate-labs/broadway/pulls/188","html_url":"https://github.com/qandidate-labs/broadway/pull/188","diff_url":"https://github.com/qandidate-labs/broadway/pull/188.diff","patch_url":"https://github.com/qandidate-labs/broadway/pull/188.patch"},"body":"This is an alternate implementation to #73. It follows some of the original AxonFramework naming and ideas but does so with a much simpler interface for building and using criteria. Essentially, I'm allowing for filtering/querying just on Aggregate Root Type, Aggregate Root ID, and Event Type.\r\n\r\nThere is currently no way to actually filter/query based on Aggregate Root Type but I didn't realize that until after it was completely implemented. :) I thought I'd be able to do it for at least the in memory store but nope! I can remove it and put it back in after #181.\r\n\r\n```php\r\n$criteria = Criteria::create()->withEventType('Acme.Foo.Event.EatFoo');\r\n\r\n$criteria = Criteria::create()->withEventTypes([\r\n    'Acme.Foo.Event.EatFoo',\r\n    'Acme.Foo.Event.CookFoo',\r\n]);\r\n\r\n$criteria = Criteria::create()->withEventType('Acme.Foo.Event.EatFoo');\r\n\r\n$criteria = Criteria::create()\r\n    ->withAggregateRootId('CA59B2DB-7782-4A63-9304-91DDEBB425E3')\r\n    ->withEventType('Acme.Foo.Event.EatFoo')\r\n;\r\n\r\n$eventStore->visitEvents($eventVisitor, $criteria);\r\n```\r\n\r\nThere are probably some PHP 5.4 `[]` arrays somewhere. Will see once Travis runs. :)\r\n\r\nTests are written for In Memory, DBAL, and DBAL w/ Binary."},"comment":{"url":"https://api.github.com/repos/qandidate-labs/broadway/issues/comments/126196862","html_url":"https://github.com/qandidate-labs/broadway/pull/188#issuecomment-126196862","issue_url":"https://api.github.com/repos/qandidate-labs/broadway/issues/188","id":126196862,"user":{"login":"simensen","id":191200,"avatar_url":"https://avatars.githubusercontent.com/u/191200?v=3","gravatar_id":"","url":"https://api.github.com/users/simensen","html_url":"https://github.com/simensen","followers_url":"https://api.github.com/users/simensen/followers","following_url":"https://api.github.com/users/simensen/following{/other_user}","gists_url":"https://api.github.com/users/simensen/gists{/gist_id}","starred_url":"https://api.github.com/users/simensen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/simensen/subscriptions","organizations_url":"https://api.github.com/users/simensen/orgs","repos_url":"https://api.github.com/users/simensen/repos","events_url":"https://api.github.com/users/simensen/events{/privacy}","received_events_url":"https://api.github.com/users/simensen/received_events","type":"User","site_admin":false},"created_at":"2015-07-30T06:09:10Z","updated_at":"2015-07-30T06:09:10Z","body":"I removed a whole lot of `with*` methods from `Criteria`, made `Criteria` required and non-nullable, swapped the argument order, removed `$allEvents` from `InMemoryEventStore`, made the checks based on checking order of aggregate type and aggregate ID, and fixed most of the other CS issues.\r\n\r\nThe only thing I didn't do was extract the criteria query building stuff from `DBALEventStore`. I looked at it and realized that doing so would probably require either 1) more refactoring than I have time for now or 2) code duplication. I don't think I'll have time to do either of these right now.\r\n\r\nThe biggest issue was the dependency on `isBinary` for how the bind values and bind types are created. In addition to that, we'd also need access to `convertIdentifierToStorageValue`.\r\n\r\nMy vote is to merge it as-is. :) However, if someone else (@asm89 offered?) wants to finish this up I'm all for it. :)"}}