{"action":"created","comment":{"url":"https://api.github.com/repos/akeneo/pim-community-dev/pulls/comments/23361974","id":23361974,"diff_hunk":"@@ -108,13 +111,39 @@ protected function findObject($class, $code)\n             return $this->referenceRepository->getReference($reference);\n         } else {\n             $repository = $this->doctrine->getManagerForClass($class)->getRepository($class);\n-            if (!$repository instanceof ReferableEntityRepositoryInterface) {\n-                throw new \\Exception(\n-                    sprintf('Repository \"%s\" of class \"%s\" is not referable', get_class($repository), $class)\n-                );\n+            if (null !== $object = $this->findOneByIdentifier($repository, $code)) {\n+                return $object;\n             }\n \n-            return $repository->findByReference($code);\n+            $message = <<<MESSAGE\n+Repository \"%s\" of class \"%s\" does not implement \"Akeneo\\Bundle\\StorageUtilsBundle\\Repository\\IdentifiableObjectRepositoryInterface\"","path":"src/Pim/Bundle/TransformBundle/Cache/DoctrineCache.php","position":31,"original_position":31,"commit_id":"edd9e89bfd005a90c66a5e5f3271816b319bea9e","original_commit_id":"edd9e89bfd005a90c66a5e5f3271816b319bea9e","user":{"login":"jjanvier","id":3691804,"avatar_url":"https://avatars.githubusercontent.com/u/3691804?v=3","gravatar_id":"","url":"https://api.github.com/users/jjanvier","html_url":"https://github.com/jjanvier","followers_url":"https://api.github.com/users/jjanvier/followers","following_url":"https://api.github.com/users/jjanvier/following{/other_user}","gists_url":"https://api.github.com/users/jjanvier/gists{/gist_id}","starred_url":"https://api.github.com/users/jjanvier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jjanvier/subscriptions","organizations_url":"https://api.github.com/users/jjanvier/orgs","repos_url":"https://api.github.com/users/jjanvier/repos","events_url":"https://api.github.com/users/jjanvier/events{/privacy}","received_events_url":"https://api.github.com/users/jjanvier/received_events","type":"User","site_admin":false},"body":"done","created_at":"2015-01-22T08:53:38Z","updated_at":"2015-01-22T08:53:38Z","html_url":"https://github.com/akeneo/pim-community-dev/pull/2020#discussion_r23361974","pull_request_url":"https://api.github.com/repos/akeneo/pim-community-dev/pulls/2020","_links":{"self":{"href":"https://api.github.com/repos/akeneo/pim-community-dev/pulls/comments/23361974"},"html":{"href":"https://github.com/akeneo/pim-community-dev/pull/2020#discussion_r23361974"},"pull_request":{"href":"https://api.github.com/repos/akeneo/pim-community-dev/pulls/2020"}}},"pull_request":{"url":"https://api.github.com/repos/akeneo/pim-community-dev/pulls/2020","id":27606350,"html_url":"https://github.com/akeneo/pim-community-dev/pull/2020","diff_url":"https://github.com/akeneo/pim-community-dev/pull/2020.diff","patch_url":"https://github.com/akeneo/pim-community-dev/pull/2020.patch","issue_url":"https://api.github.com/repos/akeneo/pim-community-dev/issues/2020","number":2020,"state":"open","locked":false,"title":"PIM-3591: introduce IdentifiableObjectRepositoryInterface","user":{"login":"jjanvier","id":3691804,"avatar_url":"https://avatars.githubusercontent.com/u/3691804?v=3","gravatar_id":"","url":"https://api.github.com/users/jjanvier","html_url":"https://github.com/jjanvier","followers_url":"https://api.github.com/users/jjanvier/followers","following_url":"https://api.github.com/users/jjanvier/following{/other_user}","gists_url":"https://api.github.com/users/jjanvier/gists{/gist_id}","starred_url":"https://api.github.com/users/jjanvier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jjanvier/subscriptions","organizations_url":"https://api.github.com/users/jjanvier/orgs","repos_url":"https://api.github.com/users/jjanvier/repos","events_url":"https://api.github.com/users/jjanvier/events{/privacy}","received_events_url":"https://api.github.com/users/jjanvier/received_events","type":"User","site_admin":false},"body":"| Q                    | A\r\n| -------------------- | ---\r\n| Bug fix?             | N\r\n| New feature?         | N\r\n| BC breaks?           | only 1 made on purpose :)\r\n| CI currently passes? | Y\r\n| Tests pass?          | Y\r\n| Scenarios pass?      | running\r\n| Checkstyle issues?*  | N\r\n| PMD issues?**        | N\r\n| Changelog updated?   | Y\r\n| Fixed tickets        |\r\n| DB schema updated?   |\r\n| Migration script?    |\r\n| Doc PR               |\r\n\r\nThis PR introduces : \r\n - `Akeneo/Bundle/StorageUtilsBundle/Doctrine/ORM/Repository/IdentifiableEntityRepository`\r\n - `Akeneo/Bundle/StorageUtilsBundle/Repository/AbstractIdentifiableEntityRepository`\r\n\r\n*... while assuring backward compatibility*\r\n\r\nPlease, note that for backward compatibility reasons : \r\n - we can not directly remove `ReferableEntityRepositoryInterface` and `ReferableEntityRepository`, otherwise no existing PIM customization will continue to work after the upgrade\r\n - the repositories that implemented `ReferableEntityRepositoryInterface` now implements `ReferableEntityRepositoryInterface` ***and*** `IdentifiableObjectRepositoryInterface`. The implementation of `ReferableEntityRepositoryInterface` will be set to deprecated in another PR (see PR https://github.com/akeneo/pim-community-dev/pull/2022 where all repositories will have an interface). The methods implemented for `ReferableEntityRepositoryInterface` are just simple shortcuts to methods implemented for `IdentifiableObjectRepositoryInterface`.\r\n - the repositories that extends `ReferableEntityRepository` ***do*** continue to extend `ReferableEntityRepository`. `ReferableEntityRepository` is simply set as deprecated for the moment. We'll encourage users to rely on repository interfaces instead of concrete classes (see PR https://github.com/akeneo/pim-community-dev/pull/2022 where all repositories will have an interface). \r\n - we have to check here and there if a repository is an `IdentifiableObjectRepositoryInterface` or a `ReferableEntityRepositoryInterface`, which introduces bad code. This bad code has been isolated in private functions.\r\n","created_at":"2015-01-19T13:23:14Z","updated_at":"2015-01-22T08:53:38Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8478a5f26c1d52d49abd7462b91674216d489b92","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/akeneo/pim-community-dev/pulls/2020/commits","review_comments_url":"https://api.github.com/repos/akeneo/pim-community-dev/pulls/2020/comments","review_comment_url":"https://api.github.com/repos/akeneo/pim-community-dev/pulls/comments/{number}","comments_url":"https://api.github.com/repos/akeneo/pim-community-dev/issues/2020/comments","statuses_url":"https://api.github.com/repos/akeneo/pim-community-dev/statuses/edd9e89bfd005a90c66a5e5f3271816b319bea9e","head":{"label":"akeneo:PIM-3591","ref":"PIM-3591","sha":"edd9e89bfd005a90c66a5e5f3271816b319bea9e","user":{"login":"akeneo","id":2510186,"avatar_url":"https://avatars.githubusercontent.com/u/2510186?v=3","gravatar_id":"","url":"https://api.github.com/users/akeneo","html_url":"https://github.com/akeneo","followers_url":"https://api.github.com/users/akeneo/followers","following_url":"https://api.github.com/users/akeneo/following{/other_user}","gists_url":"https://api.github.com/users/akeneo/gists{/gist_id}","starred_url":"https://api.github.com/users/akeneo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akeneo/subscriptions","organizations_url":"https://api.github.com/users/akeneo/orgs","repos_url":"https://api.github.com/users/akeneo/repos","events_url":"https://api.github.com/users/akeneo/events{/privacy}","received_events_url":"https://api.github.com/users/akeneo/received_events","type":"Organization","site_admin":false},"repo":{"id":5367323,"name":"pim-community-dev","full_name":"akeneo/pim-community-dev","owner":{"login":"akeneo","id":2510186,"avatar_url":"https://avatars.githubusercontent.com/u/2510186?v=3","gravatar_id":"","url":"https://api.github.com/users/akeneo","html_url":"https://github.com/akeneo","followers_url":"https://api.github.com/users/akeneo/followers","following_url":"https://api.github.com/users/akeneo/following{/other_user}","gists_url":"https://api.github.com/users/akeneo/gists{/gist_id}","starred_url":"https://api.github.com/users/akeneo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akeneo/subscriptions","organizations_url":"https://api.github.com/users/akeneo/orgs","repos_url":"https://api.github.com/users/akeneo/repos","events_url":"https://api.github.com/users/akeneo/events{/privacy}","received_events_url":"https://api.github.com/users/akeneo/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/akeneo/pim-community-dev","description":"Akeneo PIM development repository","fork":false,"url":"https://api.github.com/repos/akeneo/pim-community-dev","forks_url":"https://api.github.com/repos/akeneo/pim-community-dev/forks","keys_url":"https://api.github.com/repos/akeneo/pim-community-dev/keys{/key_id}","collaborators_url":"https://api.github.com/repos/akeneo/pim-community-dev/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/akeneo/pim-community-dev/teams","hooks_url":"https://api.github.com/repos/akeneo/pim-community-dev/hooks","issue_events_url":"https://api.github.com/repos/akeneo/pim-community-dev/issues/events{/number}","events_url":"https://api.github.com/repos/akeneo/pim-community-dev/events","assignees_url":"https://api.github.com/repos/akeneo/pim-community-dev/assignees{/user}","branches_url":"https://api.github.com/repos/akeneo/pim-community-dev/branches{/branch}","tags_url":"https://api.github.com/repos/akeneo/pim-community-dev/tags","blobs_url":"https://api.github.com/repos/akeneo/pim-community-dev/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/akeneo/pim-community-dev/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/akeneo/pim-community-dev/git/refs{/sha}","trees_url":"https://api.github.com/repos/akeneo/pim-community-dev/git/trees{/sha}","statuses_url":"https://api.github.com/repos/akeneo/pim-community-dev/statuses/{sha}","languages_url":"https://api.github.com/repos/akeneo/pim-community-dev/languages","stargazers_url":"https://api.github.com/repos/akeneo/pim-community-dev/stargazers","contributors_url":"https://api.github.com/repos/akeneo/pim-community-dev/contributors","subscribers_url":"https://api.github.com/repos/akeneo/pim-community-dev/subscribers","subscription_url":"https://api.github.com/repos/akeneo/pim-community-dev/subscription","commits_url":"https://api.github.com/repos/akeneo/pim-community-dev/commits{/sha}","git_commits_url":"https://api.github.com/repos/akeneo/pim-community-dev/git/commits{/sha}","comments_url":"https://api.github.com/repos/akeneo/pim-community-dev/comments{/number}","issue_comment_url":"https://api.github.com/repos/akeneo/pim-community-dev/issues/comments/{number}","contents_url":"https://api.github.com/repos/akeneo/pim-community-dev/contents/{+path}","compare_url":"https://api.github.com/repos/akeneo/pim-community-dev/compare/{base}...{head}","merges_url":"https://api.github.com/repos/akeneo/pim-community-dev/merges","archive_url":"https://api.github.com/repos/akeneo/pim-community-dev/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/akeneo/pim-community-dev/downloads","issues_url":"https://api.github.com/repos/akeneo/pim-community-dev/issues{/number}","pulls_url":"https://api.github.com/repos/akeneo/pim-community-dev/pulls{/number}","milestones_url":"https://api.github.com/repos/akeneo/pim-community-dev/milestones{/number}","notifications_url":"https://api.github.com/repos/akeneo/pim-community-dev/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/akeneo/pim-community-dev/labels{/name}","releases_url":"https://api.github.com/repos/akeneo/pim-community-dev/releases{/id}","created_at":"2012-08-10T09:27:26Z","updated_at":"2015-01-21T18:34:52Z","pushed_at":"2015-01-22T08:28:46Z","git_url":"git://github.com/akeneo/pim-community-dev.git","ssh_url":"git@github.com:akeneo/pim-community-dev.git","clone_url":"https://github.com/akeneo/pim-community-dev.git","svn_url":"https://github.com/akeneo/pim-community-dev","homepage":"http://akeneo.com","size":140377,"stargazers_count":191,"watchers_count":191,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":81,"mirror_url":null,"open_issues_count":41,"forks":81,"open_issues":41,"watchers":191,"default_branch":"master"}},"base":{"label":"akeneo:master","ref":"master","sha":"5d9ff552ab442bba550ac32635bf73c39d6f6e85","user":{"login":"akeneo","id":2510186,"avatar_url":"https://avatars.githubusercontent.com/u/2510186?v=3","gravatar_id":"","url":"https://api.github.com/users/akeneo","html_url":"https://github.com/akeneo","followers_url":"https://api.github.com/users/akeneo/followers","following_url":"https://api.github.com/users/akeneo/following{/other_user}","gists_url":"https://api.github.com/users/akeneo/gists{/gist_id}","starred_url":"https://api.github.com/users/akeneo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akeneo/subscriptions","organizations_url":"https://api.github.com/users/akeneo/orgs","repos_url":"https://api.github.com/users/akeneo/repos","events_url":"https://api.github.com/users/akeneo/events{/privacy}","received_events_url":"https://api.github.com/users/akeneo/received_events","type":"Organization","site_admin":false},"repo":{"id":5367323,"name":"pim-community-dev","full_name":"akeneo/pim-community-dev","owner":{"login":"akeneo","id":2510186,"avatar_url":"https://avatars.githubusercontent.com/u/2510186?v=3","gravatar_id":"","url":"https://api.github.com/users/akeneo","html_url":"https://github.com/akeneo","followers_url":"https://api.github.com/users/akeneo/followers","following_url":"https://api.github.com/users/akeneo/following{/other_user}","gists_url":"https://api.github.com/users/akeneo/gists{/gist_id}","starred_url":"https://api.github.com/users/akeneo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akeneo/subscriptions","organizations_url":"https://api.github.com/users/akeneo/orgs","repos_url":"https://api.github.com/users/akeneo/repos","events_url":"https://api.github.com/users/akeneo/events{/privacy}","received_events_url":"https://api.github.com/users/akeneo/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/akeneo/pim-community-dev","description":"Akeneo PIM development repository","fork":false,"url":"https://api.github.com/repos/akeneo/pim-community-dev","forks_url":"https://api.github.com/repos/akeneo/pim-community-dev/forks","keys_url":"https://api.github.com/repos/akeneo/pim-community-dev/keys{/key_id}","collaborators_url":"https://api.github.com/repos/akeneo/pim-community-dev/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/akeneo/pim-community-dev/teams","hooks_url":"https://api.github.com/repos/akeneo/pim-community-dev/hooks","issue_events_url":"https://api.github.com/repos/akeneo/pim-community-dev/issues/events{/number}","events_url":"https://api.github.com/repos/akeneo/pim-community-dev/events","assignees_url":"https://api.github.com/repos/akeneo/pim-community-dev/assignees{/user}","branches_url":"https://api.github.com/repos/akeneo/pim-community-dev/branches{/branch}","tags_url":"https://api.github.com/repos/akeneo/pim-community-dev/tags","blobs_url":"https://api.github.com/repos/akeneo/pim-community-dev/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/akeneo/pim-community-dev/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/akeneo/pim-community-dev/git/refs{/sha}","trees_url":"https://api.github.com/repos/akeneo/pim-community-dev/git/trees{/sha}","statuses_url":"https://api.github.com/repos/akeneo/pim-community-dev/statuses/{sha}","languages_url":"https://api.github.com/repos/akeneo/pim-community-dev/languages","stargazers_url":"https://api.github.com/repos/akeneo/pim-community-dev/stargazers","contributors_url":"https://api.github.com/repos/akeneo/pim-community-dev/contributors","subscribers_url":"https://api.github.com/repos/akeneo/pim-community-dev/subscribers","subscription_url":"https://api.github.com/repos/akeneo/pim-community-dev/subscription","commits_url":"https://api.github.com/repos/akeneo/pim-community-dev/commits{/sha}","git_commits_url":"https://api.github.com/repos/akeneo/pim-community-dev/git/commits{/sha}","comments_url":"https://api.github.com/repos/akeneo/pim-community-dev/comments{/number}","issue_comment_url":"https://api.github.com/repos/akeneo/pim-community-dev/issues/comments/{number}","contents_url":"https://api.github.com/repos/akeneo/pim-community-dev/contents/{+path}","compare_url":"https://api.github.com/repos/akeneo/pim-community-dev/compare/{base}...{head}","merges_url":"https://api.github.com/repos/akeneo/pim-community-dev/merges","archive_url":"https://api.github.com/repos/akeneo/pim-community-dev/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/akeneo/pim-community-dev/downloads","issues_url":"https://api.github.com/repos/akeneo/pim-community-dev/issues{/number}","pulls_url":"https://api.github.com/repos/akeneo/pim-community-dev/pulls{/number}","milestones_url":"https://api.github.com/repos/akeneo/pim-community-dev/milestones{/number}","notifications_url":"https://api.github.com/repos/akeneo/pim-community-dev/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/akeneo/pim-community-dev/labels{/name}","releases_url":"https://api.github.com/repos/akeneo/pim-community-dev/releases{/id}","created_at":"2012-08-10T09:27:26Z","updated_at":"2015-01-21T18:34:52Z","pushed_at":"2015-01-22T08:28:46Z","git_url":"git://github.com/akeneo/pim-community-dev.git","ssh_url":"git@github.com:akeneo/pim-community-dev.git","clone_url":"https://github.com/akeneo/pim-community-dev.git","svn_url":"https://github.com/akeneo/pim-community-dev","homepage":"http://akeneo.com","size":140377,"stargazers_count":191,"watchers_count":191,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":81,"mirror_url":null,"open_issues_count":41,"forks":81,"open_issues":41,"watchers":191,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/akeneo/pim-community-dev/pulls/2020"},"html":{"href":"https://github.com/akeneo/pim-community-dev/pull/2020"},"issue":{"href":"https://api.github.com/repos/akeneo/pim-community-dev/issues/2020"},"comments":{"href":"https://api.github.com/repos/akeneo/pim-community-dev/issues/2020/comments"},"review_comments":{"href":"https://api.github.com/repos/akeneo/pim-community-dev/pulls/2020/comments"},"review_comment":{"href":"https://api.github.com/repos/akeneo/pim-community-dev/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/akeneo/pim-community-dev/pulls/2020/commits"},"statuses":{"href":"https://api.github.com/repos/akeneo/pim-community-dev/statuses/edd9e89bfd005a90c66a5e5f3271816b319bea9e"}}}}