{"action":"created","comment":{"url":"https://api.github.com/repos/brera/dev-util-seeders/pulls/comments/39289008","id":39289008,"diff_hunk":"@@ -0,0 +1,129 @@\n+<?php\n+\n+\n+namespace Brera\\Dev\\Util\\Seeder\\CatalogGenerator;\n+\n+use Brera\\Context\\Context;\n+use Brera\\Context\\ContextSource;\n+use Brera\\Context\\VersionedContext;\n+\n+class ContextDataSetBuilder\n+{\n+    /**\n+     * @var ContextSource\n+     */\n+    private $contextSource;\n+\n+    public function __construct(ContextSource $contextSource)\n+    {\n+        $this->contextSource = $contextSource;\n+    }\n+\n+    /**\n+     * @param int $num\n+     * @param string[] $contextParts\n+     * @return array[]\n+     */\n+    public function getMultipleContextDataSetsForGivenContextsParts($num, array $contextParts)\n+    {\n+        $contexts = $this->contextSource->getContextsForParts($contextParts);\n+        return $this->getMultipleContextDataSetsForGivenContexts($num, $contexts);\n+    }\n+\n+    /**\n+     * @param int $num\n+     * @param Context[] $contexts\n+     * @return array[]\n+     */\n+    public function getMultipleContextDataSetsForGivenContexts($num, array $contexts)\n+    {\n+        return array_reduce($contexts, function ($carry, Context $context) use ($num) {\n+            return array_merge($carry, $this->getMultipleContextDataSetsForContext($num, $context));\n+        }, []);\n+    }\n+\n+    /**\n+     * @param string[] $contextParts\n+     * @return array[]\n+     */\n+    public function getContextDataSetForGivenContextsParts(array $contextParts)\n+    {\n+        return $this->getMultipleContextDataSetsForGivenContextsParts(1, $contextParts);\n+    }\n+\n+    /**\n+     * @param Context $context\n+     * @return array[]\n+     */\n+    public function getContextDataSetForGivenContext(Context $context)\n+    {\n+        return $this->getMultipleContextDataSetsForContext(1, $context);\n+    }\n+\n+    /**\n+     * @param int $num\n+     * @param Context $context\n+     * @return array[]\n+     */\n+    public function getMultipleContextDataSetsForContext($num, Context $context) // ok","path":"src/CatalogGenerator/ContextDataSetBuilder.php","position":68,"original_position":68,"commit_id":"80c3fdd0deb917b3cb70eee94511ca62a934399d","original_commit_id":"0a9f3f1a7233ce5ad6ea3aa522159ad5a54fdde0","user":{"login":"Vinai","id":72463,"avatar_url":"https://avatars.githubusercontent.com/u/72463?v=3","gravatar_id":"","url":"https://api.github.com/users/Vinai","html_url":"https://github.com/Vinai","followers_url":"https://api.github.com/users/Vinai/followers","following_url":"https://api.github.com/users/Vinai/following{/other_user}","gists_url":"https://api.github.com/users/Vinai/gists{/gist_id}","starred_url":"https://api.github.com/users/Vinai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Vinai/subscriptions","organizations_url":"https://api.github.com/users/Vinai/orgs","repos_url":"https://api.github.com/users/Vinai/repos","events_url":"https://api.github.com/users/Vinai/events{/privacy}","received_events_url":"https://api.github.com/users/Vinai/received_events","type":"User","site_admin":false},"body":"I removed the comment. This time the method is public because I wanted direct test coverage.","created_at":"2015-09-11T16:28:13Z","updated_at":"2015-09-11T16:28:13Z","html_url":"https://github.com/brera/dev-util-seeders/pull/2#discussion_r39289008","pull_request_url":"https://api.github.com/repos/brera/dev-util-seeders/pulls/2","_links":{"self":{"href":"https://api.github.com/repos/brera/dev-util-seeders/pulls/comments/39289008"},"html":{"href":"https://github.com/brera/dev-util-seeders/pull/2#discussion_r39289008"},"pull_request":{"href":"https://api.github.com/repos/brera/dev-util-seeders/pulls/2"}}},"pull_request":{"url":"https://api.github.com/repos/brera/dev-util-seeders/pulls/2","id":44666730,"html_url":"https://github.com/brera/dev-util-seeders/pull/2","diff_url":"https://github.com/brera/dev-util-seeders/pull/2.diff","patch_url":"https://github.com/brera/dev-util-seeders/pull/2.patch","issue_url":"https://api.github.com/repos/brera/dev-util-seeders/issues/2","number":2,"state":"open","locked":false,"title":"Implement catalog listing seeder (Issue #1)","user":{"login":"Vinai","id":72463,"avatar_url":"https://avatars.githubusercontent.com/u/72463?v=3","gravatar_id":"","url":"https://api.github.com/users/Vinai","html_url":"https://github.com/Vinai","followers_url":"https://api.github.com/users/Vinai/followers","following_url":"https://api.github.com/users/Vinai/following{/other_user}","gists_url":"https://api.github.com/users/Vinai/gists{/gist_id}","starred_url":"https://api.github.com/users/Vinai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Vinai/subscriptions","organizations_url":"https://api.github.com/users/Vinai/orgs","repos_url":"https://api.github.com/users/Vinai/repos","events_url":"https://api.github.com/users/Vinai/events{/privacy}","received_events_url":"https://api.github.com/users/Vinai/received_events","type":"User","site_admin":false},"body":"Run the command with\r\n```bash\r\nbin/runSeeder.php -n 1 -o catalog-seed.xml\r\n```\r\nto generate a file containing 1 product with an output file `catalog-seed.xml`.\r\nThe default output is stdout, so if you run the command without specifying an output file it will dump the XML to the terminal (where it can be redirected if needed).\r\n\r\nThe target directory for images can be specified with the `-i` or `--imageDir` command.\r\nThe default image directory is a subdirectory `product-images` within the same directory as the output file.\r\nIf the output is stdout, the default image directory is `./product-images` in the current directory.\r\n\r\nThe resulting file is then intended to be used with the `runImport.php` script.","created_at":"2015-09-10T13:24:05Z","updated_at":"2015-09-11T16:28:13Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b75489f2b4cb1f06d31af1b046cbbbbe18620e98","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/brera/dev-util-seeders/pulls/2/commits","review_comments_url":"https://api.github.com/repos/brera/dev-util-seeders/pulls/2/comments","review_comment_url":"https://api.github.com/repos/brera/dev-util-seeders/pulls/comments{/number}","comments_url":"https://api.github.com/repos/brera/dev-util-seeders/issues/2/comments","statuses_url":"https://api.github.com/repos/brera/dev-util-seeders/statuses/80c3fdd0deb917b3cb70eee94511ca62a934399d","head":{"label":"brera:product-generator-1","ref":"product-generator-1","sha":"80c3fdd0deb917b3cb70eee94511ca62a934399d","user":{"login":"brera","id":8191923,"avatar_url":"https://avatars.githubusercontent.com/u/8191923?v=3","gravatar_id":"","url":"https://api.github.com/users/brera","html_url":"https://github.com/brera","followers_url":"https://api.github.com/users/brera/followers","following_url":"https://api.github.com/users/brera/following{/other_user}","gists_url":"https://api.github.com/users/brera/gists{/gist_id}","starred_url":"https://api.github.com/users/brera/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brera/subscriptions","organizations_url":"https://api.github.com/users/brera/orgs","repos_url":"https://api.github.com/users/brera/repos","events_url":"https://api.github.com/users/brera/events{/privacy}","received_events_url":"https://api.github.com/users/brera/received_events","type":"Organization","site_admin":false},"repo":{"id":41662413,"name":"dev-util-seeders","full_name":"brera/dev-util-seeders","owner":{"login":"brera","id":8191923,"avatar_url":"https://avatars.githubusercontent.com/u/8191923?v=3","gravatar_id":"","url":"https://api.github.com/users/brera","html_url":"https://github.com/brera","followers_url":"https://api.github.com/users/brera/followers","following_url":"https://api.github.com/users/brera/following{/other_user}","gists_url":"https://api.github.com/users/brera/gists{/gist_id}","starred_url":"https://api.github.com/users/brera/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brera/subscriptions","organizations_url":"https://api.github.com/users/brera/orgs","repos_url":"https://api.github.com/users/brera/repos","events_url":"https://api.github.com/users/brera/events{/privacy}","received_events_url":"https://api.github.com/users/brera/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/brera/dev-util-seeders","description":"Command line tool and set of classes to generate fake import data.","fork":false,"url":"https://api.github.com/repos/brera/dev-util-seeders","forks_url":"https://api.github.com/repos/brera/dev-util-seeders/forks","keys_url":"https://api.github.com/repos/brera/dev-util-seeders/keys{/key_id}","collaborators_url":"https://api.github.com/repos/brera/dev-util-seeders/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/brera/dev-util-seeders/teams","hooks_url":"https://api.github.com/repos/brera/dev-util-seeders/hooks","issue_events_url":"https://api.github.com/repos/brera/dev-util-seeders/issues/events{/number}","events_url":"https://api.github.com/repos/brera/dev-util-seeders/events","assignees_url":"https://api.github.com/repos/brera/dev-util-seeders/assignees{/user}","branches_url":"https://api.github.com/repos/brera/dev-util-seeders/branches{/branch}","tags_url":"https://api.github.com/repos/brera/dev-util-seeders/tags","blobs_url":"https://api.github.com/repos/brera/dev-util-seeders/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/brera/dev-util-seeders/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/brera/dev-util-seeders/git/refs{/sha}","trees_url":"https://api.github.com/repos/brera/dev-util-seeders/git/trees{/sha}","statuses_url":"https://api.github.com/repos/brera/dev-util-seeders/statuses/{sha}","languages_url":"https://api.github.com/repos/brera/dev-util-seeders/languages","stargazers_url":"https://api.github.com/repos/brera/dev-util-seeders/stargazers","contributors_url":"https://api.github.com/repos/brera/dev-util-seeders/contributors","subscribers_url":"https://api.github.com/repos/brera/dev-util-seeders/subscribers","subscription_url":"https://api.github.com/repos/brera/dev-util-seeders/subscription","commits_url":"https://api.github.com/repos/brera/dev-util-seeders/commits{/sha}","git_commits_url":"https://api.github.com/repos/brera/dev-util-seeders/git/commits{/sha}","comments_url":"https://api.github.com/repos/brera/dev-util-seeders/comments{/number}","issue_comment_url":"https://api.github.com/repos/brera/dev-util-seeders/issues/comments{/number}","contents_url":"https://api.github.com/repos/brera/dev-util-seeders/contents/{+path}","compare_url":"https://api.github.com/repos/brera/dev-util-seeders/compare/{base}...{head}","merges_url":"https://api.github.com/repos/brera/dev-util-seeders/merges","archive_url":"https://api.github.com/repos/brera/dev-util-seeders/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/brera/dev-util-seeders/downloads","issues_url":"https://api.github.com/repos/brera/dev-util-seeders/issues{/number}","pulls_url":"https://api.github.com/repos/brera/dev-util-seeders/pulls{/number}","milestones_url":"https://api.github.com/repos/brera/dev-util-seeders/milestones{/number}","notifications_url":"https://api.github.com/repos/brera/dev-util-seeders/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/brera/dev-util-seeders/labels{/name}","releases_url":"https://api.github.com/repos/brera/dev-util-seeders/releases{/id}","created_at":"2015-08-31T07:41:53Z","updated_at":"2015-08-31T10:57:07Z","pushed_at":"2015-09-11T14:49:24Z","git_url":"git://github.com/brera/dev-util-seeders.git","ssh_url":"git@github.com:brera/dev-util-seeders.git","clone_url":"https://github.com/brera/dev-util-seeders.git","svn_url":"https://github.com/brera/dev-util-seeders","homepage":null,"size":320,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"base":{"label":"brera:master","ref":"master","sha":"793db7fc289285c34632a28424397162d2649312","user":{"login":"brera","id":8191923,"avatar_url":"https://avatars.githubusercontent.com/u/8191923?v=3","gravatar_id":"","url":"https://api.github.com/users/brera","html_url":"https://github.com/brera","followers_url":"https://api.github.com/users/brera/followers","following_url":"https://api.github.com/users/brera/following{/other_user}","gists_url":"https://api.github.com/users/brera/gists{/gist_id}","starred_url":"https://api.github.com/users/brera/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brera/subscriptions","organizations_url":"https://api.github.com/users/brera/orgs","repos_url":"https://api.github.com/users/brera/repos","events_url":"https://api.github.com/users/brera/events{/privacy}","received_events_url":"https://api.github.com/users/brera/received_events","type":"Organization","site_admin":false},"repo":{"id":41662413,"name":"dev-util-seeders","full_name":"brera/dev-util-seeders","owner":{"login":"brera","id":8191923,"avatar_url":"https://avatars.githubusercontent.com/u/8191923?v=3","gravatar_id":"","url":"https://api.github.com/users/brera","html_url":"https://github.com/brera","followers_url":"https://api.github.com/users/brera/followers","following_url":"https://api.github.com/users/brera/following{/other_user}","gists_url":"https://api.github.com/users/brera/gists{/gist_id}","starred_url":"https://api.github.com/users/brera/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brera/subscriptions","organizations_url":"https://api.github.com/users/brera/orgs","repos_url":"https://api.github.com/users/brera/repos","events_url":"https://api.github.com/users/brera/events{/privacy}","received_events_url":"https://api.github.com/users/brera/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/brera/dev-util-seeders","description":"Command line tool and set of classes to generate fake import data.","fork":false,"url":"https://api.github.com/repos/brera/dev-util-seeders","forks_url":"https://api.github.com/repos/brera/dev-util-seeders/forks","keys_url":"https://api.github.com/repos/brera/dev-util-seeders/keys{/key_id}","collaborators_url":"https://api.github.com/repos/brera/dev-util-seeders/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/brera/dev-util-seeders/teams","hooks_url":"https://api.github.com/repos/brera/dev-util-seeders/hooks","issue_events_url":"https://api.github.com/repos/brera/dev-util-seeders/issues/events{/number}","events_url":"https://api.github.com/repos/brera/dev-util-seeders/events","assignees_url":"https://api.github.com/repos/brera/dev-util-seeders/assignees{/user}","branches_url":"https://api.github.com/repos/brera/dev-util-seeders/branches{/branch}","tags_url":"https://api.github.com/repos/brera/dev-util-seeders/tags","blobs_url":"https://api.github.com/repos/brera/dev-util-seeders/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/brera/dev-util-seeders/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/brera/dev-util-seeders/git/refs{/sha}","trees_url":"https://api.github.com/repos/brera/dev-util-seeders/git/trees{/sha}","statuses_url":"https://api.github.com/repos/brera/dev-util-seeders/statuses/{sha}","languages_url":"https://api.github.com/repos/brera/dev-util-seeders/languages","stargazers_url":"https://api.github.com/repos/brera/dev-util-seeders/stargazers","contributors_url":"https://api.github.com/repos/brera/dev-util-seeders/contributors","subscribers_url":"https://api.github.com/repos/brera/dev-util-seeders/subscribers","subscription_url":"https://api.github.com/repos/brera/dev-util-seeders/subscription","commits_url":"https://api.github.com/repos/brera/dev-util-seeders/commits{/sha}","git_commits_url":"https://api.github.com/repos/brera/dev-util-seeders/git/commits{/sha}","comments_url":"https://api.github.com/repos/brera/dev-util-seeders/comments{/number}","issue_comment_url":"https://api.github.com/repos/brera/dev-util-seeders/issues/comments{/number}","contents_url":"https://api.github.com/repos/brera/dev-util-seeders/contents/{+path}","compare_url":"https://api.github.com/repos/brera/dev-util-seeders/compare/{base}...{head}","merges_url":"https://api.github.com/repos/brera/dev-util-seeders/merges","archive_url":"https://api.github.com/repos/brera/dev-util-seeders/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/brera/dev-util-seeders/downloads","issues_url":"https://api.github.com/repos/brera/dev-util-seeders/issues{/number}","pulls_url":"https://api.github.com/repos/brera/dev-util-seeders/pulls{/number}","milestones_url":"https://api.github.com/repos/brera/dev-util-seeders/milestones{/number}","notifications_url":"https://api.github.com/repos/brera/dev-util-seeders/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/brera/dev-util-seeders/labels{/name}","releases_url":"https://api.github.com/repos/brera/dev-util-seeders/releases{/id}","created_at":"2015-08-31T07:41:53Z","updated_at":"2015-08-31T10:57:07Z","pushed_at":"2015-09-11T14:49:24Z","git_url":"git://github.com/brera/dev-util-seeders.git","ssh_url":"git@github.com:brera/dev-util-seeders.git","clone_url":"https://github.com/brera/dev-util-seeders.git","svn_url":"https://github.com/brera/dev-util-seeders","homepage":null,"size":320,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/brera/dev-util-seeders/pulls/2"},"html":{"href":"https://github.com/brera/dev-util-seeders/pull/2"},"issue":{"href":"https://api.github.com/repos/brera/dev-util-seeders/issues/2"},"comments":{"href":"https://api.github.com/repos/brera/dev-util-seeders/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/brera/dev-util-seeders/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/brera/dev-util-seeders/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/brera/dev-util-seeders/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/brera/dev-util-seeders/statuses/80c3fdd0deb917b3cb70eee94511ca62a934399d"}}}}