{"action":"opened","issue":{"url":"https://api.github.com/repos/akeneo/pim-community-dev/issues/2517","labels_url":"https://api.github.com/repos/akeneo/pim-community-dev/issues/2517/labels{/name}","comments_url":"https://api.github.com/repos/akeneo/pim-community-dev/issues/2517/comments","events_url":"https://api.github.com/repos/akeneo/pim-community-dev/issues/2517/events","html_url":"https://github.com/akeneo/pim-community-dev/issues/2517","id":68619986,"number":2517,"title":"findOneBy... methods should not return false, but null if product is not found","user":{"login":"alafon","id":304638,"avatar_url":"https://avatars.githubusercontent.com/u/304638?v=3","gravatar_id":"","url":"https://api.github.com/users/alafon","html_url":"https://github.com/alafon","followers_url":"https://api.github.com/users/alafon/followers","following_url":"https://api.github.com/users/alafon/following{/other_user}","gists_url":"https://api.github.com/users/alafon/gists{/gist_id}","starred_url":"https://api.github.com/users/alafon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alafon/subscriptions","organizations_url":"https://api.github.com/users/alafon/orgs","repos_url":"https://api.github.com/users/alafon/repos","events_url":"https://api.github.com/users/alafon/events{/privacy}","received_events_url":"https://api.github.com/users/alafon/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-04-15T09:00:54Z","updated_at":"2015-04-15T09:00:54Z","closed_at":null,"body":"See : src/Pim/Bundle/CatalogBundle/Doctrine/ORM/ProductRepository.php\r\n\r\n```php\r\n    public function findOneByIdentifier($identifier)\r\n    {\r\n        $pqb = $this->queryBuilderFactory->create();\r\n        $qb = $pqb->getQueryBuilder();\r\n        $attribute = $this->getIdentifierAttribute();\r\n        $pqb->addFilter($attribute->getCode(), Operators::EQUALS, $identifier);\r\n        $result = $qb->getQuery()->execute();\r\n\r\n        return reset($result);\r\n    }\r\n```\r\n\r\nMy suggestion is that it should be implemented like this :\r\n\r\n```php\r\nreturn !empty($result) ? reset($result) : null;\r\n```\r\n\r\nBTW, the interface implemented by the repository seems to be correct and respects.\r\nIf you agree that this is an issue I can provide the PR\r\n"}}