{"action":"created","issue":{"url":"https://api.github.com/repos/schmittjoh/serializer/issues/409","repository_url":"https://api.github.com/repos/schmittjoh/serializer","labels_url":"https://api.github.com/repos/schmittjoh/serializer/issues/409/labels{/name}","comments_url":"https://api.github.com/repos/schmittjoh/serializer/issues/409/comments","events_url":"https://api.github.com/repos/schmittjoh/serializer/issues/409/events","html_url":"https://github.com/schmittjoh/serializer/pull/409","id":59604496,"number":409,"title":"Added support to read and remove current serialized object","user":{"login":"ahsanity","id":88349,"avatar_url":"https://avatars.githubusercontent.com/u/88349?v=3","gravatar_id":"","url":"https://api.github.com/users/ahsanity","html_url":"https://github.com/ahsanity","followers_url":"https://api.github.com/users/ahsanity/followers","following_url":"https://api.github.com/users/ahsanity/following{/other_user}","gists_url":"https://api.github.com/users/ahsanity/gists{/gist_id}","starred_url":"https://api.github.com/users/ahsanity/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ahsanity/subscriptions","organizations_url":"https://api.github.com/users/ahsanity/orgs","repos_url":"https://api.github.com/users/ahsanity/repos","events_url":"https://api.github.com/users/ahsanity/events{/privacy}","received_events_url":"https://api.github.com/users/ahsanity/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":13,"created_at":"2015-03-03T07:18:29Z","updated_at":"2016-06-30T12:07:40Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/schmittjoh/serializer/pulls/409","html_url":"https://github.com/schmittjoh/serializer/pull/409","diff_url":"https://github.com/schmittjoh/serializer/pull/409.diff","patch_url":"https://github.com/schmittjoh/serializer/pull/409.patch"},"body":"The method addData($key, $value) allows to add new keys to serialised objects but no further manipulation to the serialised object is possible in post serialise events. This PR adds the 2 methods: removeData($key) and getData(). This will allow manipulation of the current serialised object in post serialise event listeners. This is in response to #74, as I'm facing a similar need."},"comment":{"url":"https://api.github.com/repos/schmittjoh/serializer/issues/comments/229639547","html_url":"https://github.com/schmittjoh/serializer/pull/409#issuecomment-229639547","issue_url":"https://api.github.com/repos/schmittjoh/serializer/issues/409","id":229639547,"user":{"login":"Gaditanian","id":5592630,"avatar_url":"https://avatars.githubusercontent.com/u/5592630?v=3","gravatar_id":"","url":"https://api.github.com/users/Gaditanian","html_url":"https://github.com/Gaditanian","followers_url":"https://api.github.com/users/Gaditanian/followers","following_url":"https://api.github.com/users/Gaditanian/following{/other_user}","gists_url":"https://api.github.com/users/Gaditanian/gists{/gist_id}","starred_url":"https://api.github.com/users/Gaditanian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Gaditanian/subscriptions","organizations_url":"https://api.github.com/users/Gaditanian/orgs","repos_url":"https://api.github.com/users/Gaditanian/repos","events_url":"https://api.github.com/users/Gaditanian/events{/privacy}","received_events_url":"https://api.github.com/users/Gaditanian/received_events","type":"User","site_admin":false},"created_at":"2016-06-30T12:07:40Z","updated_at":"2016-06-30T12:07:40Z","body":"You can remove data in this way\r\n\r\n```php\r\npublic function onPreSerializeMethod(ObjectEvent $event) {\r\n    $classMetadata = $event->getContext()->getMetadataFactory()->getMetadataForClass(get_class($event->getObject()));\r\n\r\n    unset($classMetadata->propertyMetadata[$key]); // Remove \r\n\r\n  }\r\n```"}}
{"actor":{"display_login":"Gaditanian"}}