{"action":"created","comment":{"url":"https://api.github.com/repos/wearemarketing/RoutingAutoBundle/pulls/comments/26110370","id":26110370,"diff_hunk":"@@ -141,16 +154,41 @@ public function postFlush(PostFlushEventArgs $args)\n     public function postPersist(LifecycleEventArgs $eventArgs)\n     {\n         $entity = $eventArgs->getEntity();\n-        if ($this->isAutoRouteable($entity)) {\n+        if ($entity = $this->tryGetAutoRouteable($entity)) {\n             $manager = $eventArgs->getEntityManager();\n             $unitOfWork = $manager->getUnitOfWork();\n             /** @var AutoRoute $autoRoute */\n             foreach ($entity->getRoutes() as $autoRoute) {\n                 if (!$autoRoute->getContentId()) {\n-                    $autoRoute->setContentId($this->getEntityMetadata($manager, $entity)->getIdentifierValues($entity));\n+                    $id = $this->getEntityMetadata($manager, $entity)->getIdentifierValues($entity);\n+                    $autoRoute->setContentId($id);\n+                    $this->rewriteIdOnNameField($autoRoute, $id, false);","path":"Doctrine/Orm/AutoRouteListener.php","position":89,"original_position":89,"commit_id":"fb4cb1339a8fff8f32e85b9755246f0e900eb3dc","original_commit_id":"fb4cb1339a8fff8f32e85b9755246f0e900eb3dc","user":{"login":"jlaso","id":1332197,"avatar_url":"https://avatars.githubusercontent.com/u/1332197?v=3","gravatar_id":"","url":"https://api.github.com/users/jlaso","html_url":"https://github.com/jlaso","followers_url":"https://api.github.com/users/jlaso/followers","following_url":"https://api.github.com/users/jlaso/following{/other_user}","gists_url":"https://api.github.com/users/jlaso/gists{/gist_id}","starred_url":"https://api.github.com/users/jlaso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jlaso/subscriptions","organizations_url":"https://api.github.com/users/jlaso/orgs","repos_url":"https://api.github.com/users/jlaso/repos","events_url":"https://api.github.com/users/jlaso/events{/privacy}","received_events_url":"https://api.github.com/users/jlaso/received_events","type":"User","site_admin":false},"body":"I don't like so much this naming convention. The last boolean is not much clear about the intention of the rewrite method, can you refactor it to be more clear ?","created_at":"2015-03-10T10:22:10Z","updated_at":"2015-03-10T10:22:10Z","html_url":"https://github.com/wearemarketing/RoutingAutoBundle/pull/4#discussion_r26110370","pull_request_url":"https://api.github.com/repos/wearemarketing/RoutingAutoBundle/pulls/4","_links":{"self":{"href":"https://api.github.com/repos/wearemarketing/RoutingAutoBundle/pulls/comments/26110370"},"html":{"href":"https://github.com/wearemarketing/RoutingAutoBundle/pull/4#discussion_r26110370"},"pull_request":{"href":"https://api.github.com/repos/wearemarketing/RoutingAutoBundle/pulls/4"}}},"pull_request":{"url":"https://api.github.com/repos/wearemarketing/RoutingAutoBundle/pulls/4","id":30833371,"html_url":"https://github.com/wearemarketing/RoutingAutoBundle/pull/4","diff_url":"https://github.com/wearemarketing/RoutingAutoBundle/pull/4.diff","patch_url":"https://github.com/wearemarketing/RoutingAutoBundle/pull/4.patch","issue_url":"https://api.github.com/repos/wearemarketing/RoutingAutoBundle/issues/4","number":4,"state":"open","locked":false,"title":"now works even with translatable entities, also canonicalName added in order to identify route families","user":{"login":"wolfwolker","id":1926137,"avatar_url":"https://avatars.githubusercontent.com/u/1926137?v=3","gravatar_id":"","url":"https://api.github.com/users/wolfwolker","html_url":"https://github.com/wolfwolker","followers_url":"https://api.github.com/users/wolfwolker/followers","following_url":"https://api.github.com/users/wolfwolker/following{/other_user}","gists_url":"https://api.github.com/users/wolfwolker/gists{/gist_id}","starred_url":"https://api.github.com/users/wolfwolker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wolfwolker/subscriptions","organizations_url":"https://api.github.com/users/wolfwolker/orgs","repos_url":"https://api.github.com/users/wolfwolker/repos","events_url":"https://api.github.com/users/wolfwolker/events{/privacy}","received_events_url":"https://api.github.com/users/wolfwolker/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-03-10T09:21:09Z","updated_at":"2015-03-10T10:22:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1cc5fd4e29e2bd894cc48965a796f6b8207c8545","assignee":{"login":"jlaso","id":1332197,"avatar_url":"https://avatars.githubusercontent.com/u/1332197?v=3","gravatar_id":"","url":"https://api.github.com/users/jlaso","html_url":"https://github.com/jlaso","followers_url":"https://api.github.com/users/jlaso/followers","following_url":"https://api.github.com/users/jlaso/following{/other_user}","gists_url":"https://api.github.com/users/jlaso/gists{/gist_id}","starred_url":"https://api.github.com/users/jlaso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jlaso/subscriptions","organizations_url":"https://api.github.com/users/jlaso/orgs","repos_url":"https://api.github.com/users/jlaso/repos","events_url":"https://api.github.com/users/jlaso/events{/privacy}","received_events_url":"https://api.github.com/users/jlaso/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/wearemarketing/RoutingAutoBundle/pulls/4/commits","review_comments_url":"https://api.github.com/repos/wearemarketing/RoutingAutoBundle/pulls/4/comments","review_comment_url":"https://api.github.com/repos/wearemarketing/RoutingAutoBundle/pulls/comments{/number}","comments_url":"https://api.github.com/repos/wearemarketing/RoutingAutoBundle/issues/4/comments","statuses_url":"https://api.github.com/repos/wearemarketing/RoutingAutoBundle/statuses/fb4cb1339a8fff8f32e85b9755246f0e900eb3dc","head":{"label":"wearemarketing:feature/orm-autorouting","ref":"feature/orm-autorouting","sha":"fb4cb1339a8fff8f32e85b9755246f0e900eb3dc","user":{"login":"wearemarketing","id":8111431,"avatar_url":"https://avatars.githubusercontent.com/u/8111431?v=3","gravatar_id":"","url":"https://api.github.com/users/wearemarketing","html_url":"https://github.com/wearemarketing","followers_url":"https://api.github.com/users/wearemarketing/followers","following_url":"https://api.github.com/users/wearemarketing/following{/other_user}","gists_url":"https://api.github.com/users/wearemarketing/gists{/gist_id}","starred_url":"https://api.github.com/users/wearemarketing/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wearemarketing/subscriptions","organizations_url":"https://api.github.com/users/wearemarketing/orgs","repos_url":"https://api.github.com/users/wearemarketing/repos","events_url":"https://api.github.com/users/wearemarketing/events{/privacy}","received_events_url":"https://api.github.com/users/wearemarketing/received_events","type":"Organization","site_admin":false},"repo":{"id":30348535,"name":"RoutingAutoBundle","full_name":"wearemarketing/RoutingAutoBundle","owner":{"login":"wearemarketing","id":8111431,"avatar_url":"https://avatars.githubusercontent.com/u/8111431?v=3","gravatar_id":"","url":"https://api.github.com/users/wearemarketing","html_url":"https://github.com/wearemarketing","followers_url":"https://api.github.com/users/wearemarketing/followers","following_url":"https://api.github.com/users/wearemarketing/following{/other_user}","gists_url":"https://api.github.com/users/wearemarketing/gists{/gist_id}","starred_url":"https://api.github.com/users/wearemarketing/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wearemarketing/subscriptions","organizations_url":"https://api.github.com/users/wearemarketing/orgs","repos_url":"https://api.github.com/users/wearemarketing/repos","events_url":"https://api.github.com/users/wearemarketing/events{/privacy}","received_events_url":"https://api.github.com/users/wearemarketing/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/wearemarketing/RoutingAutoBundle","description":"Adding automatic route generating on top of the symfony cmf routing","fork":true,"url":"https://api.github.com/repos/wearemarketing/RoutingAutoBundle","forks_url":"https://api.github.com/repos/wearemarketing/RoutingAutoBundle/forks","keys_url":"https://api.github.com/repos/wearemarketing/RoutingAutoBundle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wearemarketing/RoutingAutoBundle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wearemarketing/RoutingAutoBundle/teams","hooks_url":"https://api.github.com/repos/wearemarketing/RoutingAutoBundle/hooks","issue_events_url":"https://api.github.com/repos/wearemarketing/RoutingAutoBundle/issues/events{/number}","events_url":"https://api.github.com/repos/wearemarketing/RoutingAutoBundle/events","assignees_url":"https://api.github.com/repos/wearemarketing/RoutingAutoBundle/assignees{/user}","branches_url":"https://api.github.com/repos/wearemarketing/RoutingAutoBundle/branches{/branch}","tags_url":"https://api.github.com/repos/wearemarketing/RoutingAutoBundle/tags","blobs_url":"https://api.github.com/repos/wearemarketing/RoutingAutoBundle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wearemarketing/RoutingAutoBundle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wearemarketing/RoutingAutoBundle/git/refs{/sha}","trees_url":"https://api.github.com/repos/wearemarketing/RoutingAutoBundle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wearemarketing/RoutingAutoBundle/statuses/{sha}","languages_url":"https://api.github.com/repos/wearemarketing/RoutingAutoBundle/languages","stargazers_url":"https://api.github.com/repos/wearemarketing/RoutingAutoBundle/stargazers","contributors_url":"https://api.github.com/repos/wearemarketing/RoutingAutoBundle/contributors","subscribers_url":"https://api.github.com/repos/wearemarketing/RoutingAutoBundle/subscribers","subscription_url":"https://api.github.com/repos/wearemarketing/RoutingAutoBundle/subscription","commits_url":"https://api.github.com/repos/wearemarketing/RoutingAutoBundle/commits{/sha}","git_commits_url":"https://api.github.com/repos/wearemarketing/RoutingAutoBundle/git/commits{/sha}","comments_url":"https://api.github.com/repos/wearemarketing/RoutingAutoBundle/comments{/number}","issue_comment_url":"https://api.github.com/repos/wearemarketing/RoutingAutoBundle/issues/comments{/number}","contents_url":"https://api.github.com/repos/wearemarketing/RoutingAutoBundle/contents/{+path}","compare_url":"https://api.github.com/repos/wearemarketing/RoutingAutoBundle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wearemarketing/RoutingAutoBundle/merges","archive_url":"https://api.github.com/repos/wearemarketing/RoutingAutoBundle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wearemarketing/RoutingAutoBundle/downloads","issues_url":"https://api.github.com/repos/wearemarketing/RoutingAutoBundle/issues{/number}","pulls_url":"https://api.github.com/repos/wearemarketing/RoutingAutoBundle/pulls{/number}","milestones_url":"https://api.github.com/repos/wearemarketing/RoutingAutoBundle/milestones{/number}","notifications_url":"https://api.github.com/repos/wearemarketing/RoutingAutoBundle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wearemarketing/RoutingAutoBundle/labels{/name}","releases_url":"https://api.github.com/repos/wearemarketing/RoutingAutoBundle/releases{/id}","created_at":"2015-02-05T09:53:22Z","updated_at":"2015-03-04T15:32:17Z","pushed_at":"2015-03-10T09:19:01Z","git_url":"git://github.com/wearemarketing/RoutingAutoBundle.git","ssh_url":"git@github.com:wearemarketing/RoutingAutoBundle.git","clone_url":"https://github.com/wearemarketing/RoutingAutoBundle.git","svn_url":"https://github.com/wearemarketing/RoutingAutoBundle","homepage":null,"size":792,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":0,"default_branch":"master"}},"base":{"label":"wearemarketing:master","ref":"master","sha":"f31813ddb5f2d5a6138128bdcf1aa682339d0798","user":{"login":"wearemarketing","id":8111431,"avatar_url":"https://avatars.githubusercontent.com/u/8111431?v=3","gravatar_id":"","url":"https://api.github.com/users/wearemarketing","html_url":"https://github.com/wearemarketing","followers_url":"https://api.github.com/users/wearemarketing/followers","following_url":"https://api.github.com/users/wearemarketing/following{/other_user}","gists_url":"https://api.github.com/users/wearemarketing/gists{/gist_id}","starred_url":"https://api.github.com/users/wearemarketing/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wearemarketing/subscriptions","organizations_url":"https://api.github.com/users/wearemarketing/orgs","repos_url":"https://api.github.com/users/wearemarketing/repos","events_url":"https://api.github.com/users/wearemarketing/events{/privacy}","received_events_url":"https://api.github.com/users/wearemarketing/received_events","type":"Organization","site_admin":false},"repo":{"id":30348535,"name":"RoutingAutoBundle","full_name":"wearemarketing/RoutingAutoBundle","owner":{"login":"wearemarketing","id":8111431,"avatar_url":"https://avatars.githubusercontent.com/u/8111431?v=3","gravatar_id":"","url":"https://api.github.com/users/wearemarketing","html_url":"https://github.com/wearemarketing","followers_url":"https://api.github.com/users/wearemarketing/followers","following_url":"https://api.github.com/users/wearemarketing/following{/other_user}","gists_url":"https://api.github.com/users/wearemarketing/gists{/gist_id}","starred_url":"https://api.github.com/users/wearemarketing/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wearemarketing/subscriptions","organizations_url":"https://api.github.com/users/wearemarketing/orgs","repos_url":"https://api.github.com/users/wearemarketing/repos","events_url":"https://api.github.com/users/wearemarketing/events{/privacy}","received_events_url":"https://api.github.com/users/wearemarketing/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/wearemarketing/RoutingAutoBundle","description":"Adding automatic route generating on top of the symfony cmf routing","fork":true,"url":"https://api.github.com/repos/wearemarketing/RoutingAutoBundle","forks_url":"https://api.github.com/repos/wearemarketing/RoutingAutoBundle/forks","keys_url":"https://api.github.com/repos/wearemarketing/RoutingAutoBundle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wearemarketing/RoutingAutoBundle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wearemarketing/RoutingAutoBundle/teams","hooks_url":"https://api.github.com/repos/wearemarketing/RoutingAutoBundle/hooks","issue_events_url":"https://api.github.com/repos/wearemarketing/RoutingAutoBundle/issues/events{/number}","events_url":"https://api.github.com/repos/wearemarketing/RoutingAutoBundle/events","assignees_url":"https://api.github.com/repos/wearemarketing/RoutingAutoBundle/assignees{/user}","branches_url":"https://api.github.com/repos/wearemarketing/RoutingAutoBundle/branches{/branch}","tags_url":"https://api.github.com/repos/wearemarketing/RoutingAutoBundle/tags","blobs_url":"https://api.github.com/repos/wearemarketing/RoutingAutoBundle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wearemarketing/RoutingAutoBundle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wearemarketing/RoutingAutoBundle/git/refs{/sha}","trees_url":"https://api.github.com/repos/wearemarketing/RoutingAutoBundle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wearemarketing/RoutingAutoBundle/statuses/{sha}","languages_url":"https://api.github.com/repos/wearemarketing/RoutingAutoBundle/languages","stargazers_url":"https://api.github.com/repos/wearemarketing/RoutingAutoBundle/stargazers","contributors_url":"https://api.github.com/repos/wearemarketing/RoutingAutoBundle/contributors","subscribers_url":"https://api.github.com/repos/wearemarketing/RoutingAutoBundle/subscribers","subscription_url":"https://api.github.com/repos/wearemarketing/RoutingAutoBundle/subscription","commits_url":"https://api.github.com/repos/wearemarketing/RoutingAutoBundle/commits{/sha}","git_commits_url":"https://api.github.com/repos/wearemarketing/RoutingAutoBundle/git/commits{/sha}","comments_url":"https://api.github.com/repos/wearemarketing/RoutingAutoBundle/comments{/number}","issue_comment_url":"https://api.github.com/repos/wearemarketing/RoutingAutoBundle/issues/comments{/number}","contents_url":"https://api.github.com/repos/wearemarketing/RoutingAutoBundle/contents/{+path}","compare_url":"https://api.github.com/repos/wearemarketing/RoutingAutoBundle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wearemarketing/RoutingAutoBundle/merges","archive_url":"https://api.github.com/repos/wearemarketing/RoutingAutoBundle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wearemarketing/RoutingAutoBundle/downloads","issues_url":"https://api.github.com/repos/wearemarketing/RoutingAutoBundle/issues{/number}","pulls_url":"https://api.github.com/repos/wearemarketing/RoutingAutoBundle/pulls{/number}","milestones_url":"https://api.github.com/repos/wearemarketing/RoutingAutoBundle/milestones{/number}","notifications_url":"https://api.github.com/repos/wearemarketing/RoutingAutoBundle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wearemarketing/RoutingAutoBundle/labels{/name}","releases_url":"https://api.github.com/repos/wearemarketing/RoutingAutoBundle/releases{/id}","created_at":"2015-02-05T09:53:22Z","updated_at":"2015-03-04T15:32:17Z","pushed_at":"2015-03-10T09:19:01Z","git_url":"git://github.com/wearemarketing/RoutingAutoBundle.git","ssh_url":"git@github.com:wearemarketing/RoutingAutoBundle.git","clone_url":"https://github.com/wearemarketing/RoutingAutoBundle.git","svn_url":"https://github.com/wearemarketing/RoutingAutoBundle","homepage":null,"size":792,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/wearemarketing/RoutingAutoBundle/pulls/4"},"html":{"href":"https://github.com/wearemarketing/RoutingAutoBundle/pull/4"},"issue":{"href":"https://api.github.com/repos/wearemarketing/RoutingAutoBundle/issues/4"},"comments":{"href":"https://api.github.com/repos/wearemarketing/RoutingAutoBundle/issues/4/comments"},"review_comments":{"href":"https://api.github.com/repos/wearemarketing/RoutingAutoBundle/pulls/4/comments"},"review_comment":{"href":"https://api.github.com/repos/wearemarketing/RoutingAutoBundle/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/wearemarketing/RoutingAutoBundle/pulls/4/commits"},"statuses":{"href":"https://api.github.com/repos/wearemarketing/RoutingAutoBundle/statuses/fb4cb1339a8fff8f32e85b9755246f0e900eb3dc"}}}}