{"action":"created","comment":{"url":"https://api.github.com/repos/akeneo/pim-community-dev/pulls/comments/28681093","id":28681093,"diff_hunk":"@@ -0,0 +1,172 @@\n+<?php\n+\n+namespace Pim\\Bundle\\BaseConnectorBundle\\Processor\\Denormalization;\n+\n+use Akeneo\\Bundle\\BatchBundle\\Entity\\StepExecution;\n+use Akeneo\\Bundle\\BatchBundle\\Item\\AbstractConfigurableStepElement;\n+use Akeneo\\Bundle\\BatchBundle\\Item\\InvalidItemException;\n+use Akeneo\\Bundle\\BatchBundle\\Item\\ItemProcessorInterface;\n+use Akeneo\\Bundle\\BatchBundle\\Step\\StepExecutionAwareInterface;\n+use Akeneo\\Component\\StorageUtils\\Detacher\\ObjectDetacherInterface;\n+use Akeneo\\Bundle\\StorageUtilsBundle\\Repository\\IdentifiableObjectRepositoryInterface;\n+use Pim\\Bundle\\TransformBundle\\Exception\\MissingIdentifierException;\n+use Symfony\\Component\\Validator\\ConstraintViolationInterface;\n+use Symfony\\Component\\Validator\\ConstraintViolationListInterface;\n+use Symfony\\Component\\Validator\\ValidatorInterface;\n+\n+/**\n+ * TODO: rework of the current abstract processor\n+ *\n+ * Abstract processor to provide a way to denormalize array data to object by,\n+ * - fetch an existing object or create it\n+ * - denormalize item to update the object\n+ * - validate the object\n+ * - skip the object if it contains invalid data\n+ *\n+ * @author    Julien Janvier <julien.janvier@akeneo.com>\n+ * @copyright 2015 Akeneo SAS (http://www.akeneo.com)\n+ * @license   http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)\n+ */\n+abstract class AbstractReworkedProcessor extends AbstractConfigurableStepElement implements\n+    ItemProcessorInterface,\n+    StepExecutionAwareInterface\n+{\n+    /** @var StepExecution */\n+    protected $stepExecution;\n+\n+    /** @var IdentifiableObjectRepositoryInterface */\n+    protected $repository;\n+\n+    /** @var ValidatorInterface */\n+    protected $validator;\n+\n+    /** @var ObjectDetacherInterface */\n+    protected $detacher;\n+\n+    /**\n+     * @param IdentifiableObjectRepositoryInterface $repository repository to search the object in\n+     * @param ValidatorInterface                    $validator  validator of the object\n+     * @param ObjectDetacherInterface               $detacher   object detacher\n+     */\n+    public function __construct(\n+        IdentifiableObjectRepositoryInterface $repository,\n+        ValidatorInterface $validator,\n+        ObjectDetacherInterface $detacher\n+    ) {\n+        $this->repository = $repository;\n+        $this->validator = $validator;\n+        $this->detacher = $detacher;\n+    }\n+\n+    /**\n+     * {@inheritdoc}\n+     */\n+    public function getConfigurationFields()\n+    {\n+        return array();\n+    }\n+\n+    /**\n+     * {@inheritdoc}\n+     */\n+    public function setStepExecution(StepExecution $stepExecution)\n+    {\n+        $this->stepExecution = $stepExecution;\n+    }\n+\n+    /**\n+     * Find an object according to its identifiers from a repository.\n+     *\n+     * @param IdentifiableObjectRepositoryInterface $repository the repository to search inside\n+     * @param array                                 $data       the data that is currently processed\n+     *\n+     * @return object|null\n+     *\n+     * @throws MissingIdentifierException in case the processed data do not allow to retrieve an object\n+     *                                    by its identifiers properly\n+     */\n+    protected function findObject(IdentifiableObjectRepositoryInterface $repository, array $data)\n+    {\n+        $properties = $repository->getIdentifierProperties();\n+        $references = [];\n+        foreach ($properties as $property) {\n+            if (!isset($data[$property])) {\n+                throw new MissingIdentifierException();","path":"src/Pim/Bundle/BaseConnectorBundle/Processor/Denormalization/AbstractReworkedProcessor.php","position":94,"original_position":94,"commit_id":"9fd43a18e9c8ec36cccb2d3ccfe094162b434d89","original_commit_id":"9fd43a18e9c8ec36cccb2d3ccfe094162b434d89","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":"real error message","created_at":"2015-04-20T11:29:35Z","updated_at":"2015-04-20T11:29:35Z","html_url":"https://github.com/akeneo/pim-community-dev/pull/2540#discussion_r28681093","pull_request_url":"https://api.github.com/repos/akeneo/pim-community-dev/pulls/2540","_links":{"self":{"href":"https://api.github.com/repos/akeneo/pim-community-dev/pulls/comments/28681093"},"html":{"href":"https://github.com/akeneo/pim-community-dev/pull/2540#discussion_r28681093"},"pull_request":{"href":"https://api.github.com/repos/akeneo/pim-community-dev/pulls/2540"}}},"pull_request":{"url":"https://api.github.com/repos/akeneo/pim-community-dev/pulls/2540","id":33520225,"html_url":"https://github.com/akeneo/pim-community-dev/pull/2540","diff_url":"https://github.com/akeneo/pim-community-dev/pull/2540.diff","patch_url":"https://github.com/akeneo/pim-community-dev/pull/2540.patch","issue_url":"https://api.github.com/repos/akeneo/pim-community-dev/issues/2540","number":2540,"state":"open","locked":false,"title":"[WIP] PIM-3832 Revamp product import","user":{"login":"nidup","id":2104359,"avatar_url":"https://avatars.githubusercontent.com/u/2104359?v=3","gravatar_id":"","url":"https://api.github.com/users/nidup","html_url":"https://github.com/nidup","followers_url":"https://api.github.com/users/nidup/followers","following_url":"https://api.github.com/users/nidup/following{/other_user}","gists_url":"https://api.github.com/users/nidup/gists{/gist_id}","starred_url":"https://api.github.com/users/nidup/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nidup/subscriptions","organizations_url":"https://api.github.com/users/nidup/orgs","repos_url":"https://api.github.com/users/nidup/repos","events_url":"https://api.github.com/users/nidup/events{/privacy}","received_events_url":"https://api.github.com/users/nidup/received_events","type":"User","site_admin":false},"body":"| Q                    | A\r\n| -------------------- | ---\r\n| Bug fix?             |\r\n| New feature?         |\r\n| BC breaks?           |\r\n| CI currently passes? |\r\n| Tests pass?          |\r\n| Scenarios pass?      |\r\n| Checkstyle issues?*  |\r\n| PMD issues?**        |\r\n| Changelog updated?   |\r\n| Fixed tickets        |\r\n| DB schema updated?   |\r\n| Migration script?    |\r\n| Doc PR               |","created_at":"2015-04-17T07:26:22Z","updated_at":"2015-04-20T11:29:35Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bd666c770ff6583eda41f34377f896a1c0524fbb","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/akeneo/pim-community-dev/pulls/2540/commits","review_comments_url":"https://api.github.com/repos/akeneo/pim-community-dev/pulls/2540/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/2540/comments","statuses_url":"https://api.github.com/repos/akeneo/pim-community-dev/statuses/9fd43a18e9c8ec36cccb2d3ccfe094162b434d89","head":{"label":"akeneo:PIM-3832-import-product","ref":"PIM-3832-import-product","sha":"9fd43a18e9c8ec36cccb2d3ccfe094162b434d89","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-04-16T20:28:17Z","pushed_at":"2015-04-20T09:53:01Z","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":161727,"stargazers_count":216,"watchers_count":216,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":104,"mirror_url":null,"open_issues_count":58,"forks":104,"open_issues":58,"watchers":216,"default_branch":"master"}},"base":{"label":"akeneo:master","ref":"master","sha":"e7ab9a9acc7e85c61b8cdbf32c16a0851cc6ddc9","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-04-16T20:28:17Z","pushed_at":"2015-04-20T09:53:01Z","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":161727,"stargazers_count":216,"watchers_count":216,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":104,"mirror_url":null,"open_issues_count":58,"forks":104,"open_issues":58,"watchers":216,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/akeneo/pim-community-dev/pulls/2540"},"html":{"href":"https://github.com/akeneo/pim-community-dev/pull/2540"},"issue":{"href":"https://api.github.com/repos/akeneo/pim-community-dev/issues/2540"},"comments":{"href":"https://api.github.com/repos/akeneo/pim-community-dev/issues/2540/comments"},"review_comments":{"href":"https://api.github.com/repos/akeneo/pim-community-dev/pulls/2540/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/2540/commits"},"statuses":{"href":"https://api.github.com/repos/akeneo/pim-community-dev/statuses/9fd43a18e9c8ec36cccb2d3ccfe094162b434d89"}}}}