{"action":"created","comment":{"url":"https://api.github.com/repos/akeneo/pim-community-dev/pulls/comments/78709770","id":78709770,"diff_hunk":"@@ -0,0 +1,89 @@\n+<?php\n+\n+namespace Pim\\Bundle\\EnrichBundle\\Doctrine\\ORM\\Repository;\n+\n+use Akeneo\\Component\\StorageUtils\\Repository\\SearchableRepositoryInterface;\n+use Doctrine\\ORM\\EntityManagerInterface;\n+use Doctrine\\ORM\\QueryBuilder;\n+use Pim\\Component\\Catalog\\Model\\AttributeOptionInterface;\n+\n+/**\n+ * AttributeOption searchable repository\n+ *\n+ * @author    Philippe Mossière <philippe.mossiere@akeneo.com>\n+ * @copyright 2016 Akeneo SAS (http://www.akeneo.com)\n+ * @license   http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)\n+ */\n+class AttributeOptionSearchableRepository implements SearchableRepositoryInterface\n+{\n+    /** @var EntityManagerInterface */\n+    protected $entityManager;\n+\n+    /** @var string */\n+    protected $entityName;\n+\n+    /**\n+     * @param EntityManagerInterface $entityManager\n+     * @param string                 $entityName\n+     */\n+    public function __construct(EntityManagerInterface $entityManager, $entityName)\n+    {\n+        $this->entityManager = $entityManager;\n+        $this->entityName    = $entityName;\n+    }\n+\n+    /**\n+     * {@inheritdoc}\n+     *\n+     * @return AttributeOptionInterface[]\n+     */\n+    public function findBySearch($search = null, array $options = [])\n+    {\n+        $qb = $this->entityManager->createQueryBuilder();\n+\n+        $qb->select('o')\n+            ->addSelect('v')\n+            ->from($this->entityName, 'o')\n+            ->leftJoin('o.optionValues', 'v')\n+            ->andWhere('o.attribute=:attribute')\n+            ->orderBy('o.sortOrder')\n+            ->setParameter('attribute', $options['collectionId']);\n+\n+        if ($search) {\n+            $qb->andWhere('v.value like :search OR o.code LIKE :search')\n+                ->setParameter('search', \"%$search%\");\n+        }\n+\n+        $qb = $this->applyQueryOptions($qb, $options);\n+\n+        return $qb->getQuery()->getResult();\n+    }\n+\n+    /**\n+     * @param QueryBuilder $qb\n+     * @param array        $options\n+     *\n+     * @return QueryBuilder\n+     */\n+    protected function applyQueryOptions(QueryBuilder $qb, array $options)\n+    {\n+        if (isset($options['identifiers']) && is_array($options['identifiers']) && !empty($options['identifiers'])) {\n+            $qb->andWhere('o.code in (:codes)');","path":"src/Pim/Bundle/EnrichBundle/Doctrine/ORM/Repository/AttributeOptionSearchableRepository.php","position":71,"original_position":71,"commit_id":"baac0adcfd235145a264888976cf88baa540ae7f","original_commit_id":"d1486903ac76929b137072cbba30f9d076fde716","user":{"login":"juliensnz","id":1117272,"avatar_url":"https://avatars.githubusercontent.com/u/1117272?v=3","gravatar_id":"","url":"https://api.github.com/users/juliensnz","html_url":"https://github.com/juliensnz","followers_url":"https://api.github.com/users/juliensnz/followers","following_url":"https://api.github.com/users/juliensnz/following{/other_user}","gists_url":"https://api.github.com/users/juliensnz/gists{/gist_id}","starred_url":"https://api.github.com/users/juliensnz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/juliensnz/subscriptions","organizations_url":"https://api.github.com/users/juliensnz/orgs","repos_url":"https://api.github.com/users/juliensnz/repos","events_url":"https://api.github.com/users/juliensnz/events{/privacy}","received_events_url":"https://api.github.com/users/juliensnz/received_events","type":"User","site_admin":false},"body":"👍 ","created_at":"2016-09-14T08:54:28Z","updated_at":"2016-09-14T08:54:28Z","html_url":"https://github.com/akeneo/pim-community-dev/pull/4932#discussion_r78709770","pull_request_url":"https://api.github.com/repos/akeneo/pim-community-dev/pulls/4932","_links":{"self":{"href":"https://api.github.com/repos/akeneo/pim-community-dev/pulls/comments/78709770"},"html":{"href":"https://github.com/akeneo/pim-community-dev/pull/4932#discussion_r78709770"},"pull_request":{"href":"https://api.github.com/repos/akeneo/pim-community-dev/pulls/4932"}}},"pull_request":{"url":"https://api.github.com/repos/akeneo/pim-community-dev/pulls/4932","id":83120661,"html_url":"https://github.com/akeneo/pim-community-dev/pull/4932","diff_url":"https://github.com/akeneo/pim-community-dev/pull/4932.diff","patch_url":"https://github.com/akeneo/pim-community-dev/pull/4932.patch","issue_url":"https://api.github.com/repos/akeneo/pim-community-dev/issues/4932","number":4932,"state":"open","locked":false,"title":"PIM-5777: PEF attribute values not refreshed when locale is changed","user":{"login":"momoss","id":17565301,"avatar_url":"https://avatars.githubusercontent.com/u/17565301?v=3","gravatar_id":"","url":"https://api.github.com/users/momoss","html_url":"https://github.com/momoss","followers_url":"https://api.github.com/users/momoss/followers","following_url":"https://api.github.com/users/momoss/following{/other_user}","gists_url":"https://api.github.com/users/momoss/gists{/gist_id}","starred_url":"https://api.github.com/users/momoss/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/momoss/subscriptions","organizations_url":"https://api.github.com/users/momoss/orgs","repos_url":"https://api.github.com/users/momoss/repos","events_url":"https://api.github.com/users/momoss/events{/privacy}","received_events_url":"https://api.github.com/users/momoss/received_events","type":"User","site_admin":false},"body":"Refresh PEF attributes labels values for multi-select and simple-select when locale is changed.\r\n\r\n| Q                                 | A\r\n| --------------------------------- | ---\r\n| Added Specs                       | N\r\n| Added Behats                      | N\r\n| Changelog updated                 | \r\n| Review and 2 GTM                  |\r\n| Micro Demo to the PO (Story only) | N\r\n| Migration script                  | N\r\n| Tech Doc                          | N\r\n","created_at":"2016-08-29T15:45:01Z","updated_at":"2016-09-14T08:54:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b3119f7c445afc2ed4c6f967928c47ed2064d7a3","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/akeneo/pim-community-dev/pulls/4932/commits","review_comments_url":"https://api.github.com/repos/akeneo/pim-community-dev/pulls/4932/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/4932/comments","statuses_url":"https://api.github.com/repos/akeneo/pim-community-dev/statuses/baac0adcfd235145a264888976cf88baa540ae7f","head":{"label":"akeneo:PIM-5777","ref":"PIM-5777","sha":"baac0adcfd235145a264888976cf88baa540ae7f","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":"[Community Development Repository] The open source Product Information Management (PIM)","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}","deployments_url":"https://api.github.com/repos/akeneo/pim-community-dev/deployments","created_at":"2012-08-10T09:27:26Z","updated_at":"2016-09-08T20:29:54Z","pushed_at":"2016-09-14T08:54:00Z","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://www.akeneo.com","size":152698,"stargazers_count":338,"watchers_count":338,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":169,"mirror_url":null,"open_issues_count":117,"forks":169,"open_issues":117,"watchers":338,"default_branch":"master"}},"base":{"label":"akeneo:1.5","ref":"1.5","sha":"67cb80ae7ba64f07e3d634b29224a84a4202bf8f","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":"[Community Development Repository] The open source Product Information Management (PIM)","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}","deployments_url":"https://api.github.com/repos/akeneo/pim-community-dev/deployments","created_at":"2012-08-10T09:27:26Z","updated_at":"2016-09-08T20:29:54Z","pushed_at":"2016-09-14T08:54:00Z","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://www.akeneo.com","size":152698,"stargazers_count":338,"watchers_count":338,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":169,"mirror_url":null,"open_issues_count":117,"forks":169,"open_issues":117,"watchers":338,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/akeneo/pim-community-dev/pulls/4932"},"html":{"href":"https://github.com/akeneo/pim-community-dev/pull/4932"},"issue":{"href":"https://api.github.com/repos/akeneo/pim-community-dev/issues/4932"},"comments":{"href":"https://api.github.com/repos/akeneo/pim-community-dev/issues/4932/comments"},"review_comments":{"href":"https://api.github.com/repos/akeneo/pim-community-dev/pulls/4932/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/4932/commits"},"statuses":{"href":"https://api.github.com/repos/akeneo/pim-community-dev/statuses/baac0adcfd235145a264888976cf88baa540ae7f"}}}}
{"actor":{"display_login":"juliensnz"}}