GitHub PullRequestReviewCommentEvent at 2014-10-08 10:48:19
Repository: phpcr-shell
Actor: dbu
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/phpcr/phpcr-shell/pulls/comments/18574690","id":18574690,"diff_hunk":"@@ -6,19 +6,50 @@\n use Symfony\\Component\\Console\\Input\\InputInterface;\n use Symfony\\Component\\Console\\Output\\OutputInterface;\n use PHPCR\\Shell\\Query\\UpdateParser;\n+use Jackalope\\Query\\QOM\\ComparisonConstraint;\n+use Jackalope\\Query\\QOM\\PropertyValue;\n+use PHPCR\\Query\\QOM\\QueryObjectModelConstantsInterface;\n+use PHPCR\\Query\\QOM\\LiteralInterface;\n+use PHPCR\\Shell\\Query\\UpdateProcessor;\n \n class QueryUpdateCommand extends Command\n {\n+    /**\n+     * @var OutputInterface\n+     */\n+    protected $output;\n+\n     protected function configure()\n     {\n         $this->setName('update');\n         $this->setDescription('Execute an UPDATE JCR-SQL2 query');\n         $this->addArgument('query');\n         $this->setHelp(<<<EOT\n-Execute a JCR-SQL2 update query. Unlike other commands you can enter a query literally:\n+Execute a PHPCR-Shell JCR-SQL2 update query. Tou can enter a query literally:","path":"src/PHPCR/Shell/Console/Command/Phpcr/QueryUpdateCommand.php","position":24,"original_position":24,"commit_id":"c60428f75429d1559ee13b49672b2b68687b9da7","original_commit_id":"c60428f75429d1559ee13b49672b2b68687b9da7","user":{"login":"dbu","id":76576,"avatar_url":"https://avatars.githubusercontent.com/u/76576?v=2","gravatar_id":"","url":"https://api.github.com/users/dbu","html_url":"https://github.com/dbu","followers_url":"https://api.github.com/users/dbu/followers","following_url":"https://api.github.com/users/dbu/following{/other_user}","gists_url":"https://api.github.com/users/dbu/gists{/gist_id}","starred_url":"https://api.github.com/users/dbu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dbu/subscriptions","organizations_url":"https://api.github.com/users/dbu/orgs","repos_url":"https://api.github.com/users/dbu/repos","events_url":"https://api.github.com/users/dbu/events{/privacy}","received_events_url":"https://api.github.com/users/dbu/received_events","type":"User","site_admin":false},"body":"\"Tou\"?","created_at":"2014-10-08T10:48:19Z","updated_at":"2014-10-08T10:48:19Z","html_url":"https://github.com/phpcr/phpcr-shell/pull/90#discussion_r18574690","pull_request_url":"https://api.github.com/repos/phpcr/phpcr-shell/pulls/90","_links":{"self":{"href":"https://api.github.com/repos/phpcr/phpcr-shell/pulls/comments/18574690"},"html":{"href":"https://github.com/phpcr/phpcr-shell/pull/90#discussion_r18574690"},"pull_request":{"href":"https://api.github.com/repos/phpcr/phpcr-shell/pulls/90"}}},"pull_request":{"url":"https://api.github.com/repos/phpcr/phpcr-shell/pulls/90","id":20468590,"html_url":"https://github.com/phpcr/phpcr-shell/pull/90","diff_url":"https://github.com/phpcr/phpcr-shell/pull/90.diff","patch_url":"https://github.com/phpcr/phpcr-shell/pull/90.patch","issue_url":"https://api.github.com/repos/phpcr/phpcr-shell/issues/90","number":90,"state":"open","locked":false,"title":"[query] Full support for manipulating multivalue properties","user":{"login":"dantleech","id":530801,"avatar_url":"https://avatars.githubusercontent.com/u/530801?v=2","gravatar_id":"","url":"https://api.github.com/users/dantleech","html_url":"https://github.com/dantleech","followers_url":"https://api.github.com/users/dantleech/followers","following_url":"https://api.github.com/users/dantleech/following{/other_user}","gists_url":"https://api.github.com/users/dantleech/gists{/gist_id}","starred_url":"https://api.github.com/users/dantleech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dantleech/subscriptions","organizations_url":"https://api.github.com/users/dantleech/orgs","repos_url":"https://api.github.com/users/dantleech/repos","events_url":"https://api.github.com/users/dantleech/events{/privacy}","received_events_url":"https://api.github.com/users/dantleech/received_events","type":"User","site_admin":false},"body":"Adds support for updating multivalue properties with the UPDATE query:\r\n\r\nUPDATE: This PR now includes support for evaluating functions as values over the previous syntax for updating multivalues properties. Currently only array functions are implemented.\r\n\r\nThe functions are based on the Postgres array functions.\r\n\r\n````\r\narray_remove($fieldSpec, 'ValueToRemove')\r\narray_replace($fieldSpec, 'ValueToReplace', 'Replacement');\r\narray_append($fieldSpec, 'ValueToAppend);\r\n````\r\n\r\n````cucumber\r\n    Scenario: Replace a multivalue index by value\r\n        Given I execute the \"UPDATE [nt:unstructured] AS a SET a.tags = 'Rockets' WHERE a.tags = 'Trains'\" command\r\n    Scenario: Set a multivalue value\r\n        Given I execute the \"UPDATE [nt:unstructured] AS a SET a.tags = ['Rockets', 'Dragons'] WHERE a.tags = 'Trains'\" command\r\n    Scenario: Update single multivalue\r\n        Given I execute the \"UPDATE [nt:unstructured] AS a SET a.tags = array_replace(a.tags, 'Planes', 'Rockets') WHERE a.tags = 'Planes'\" command\r\n    Scenario: Remove single multivalue\r\n        Given I execute the \"UPDATE [nt:unstructured] AS a SET a.tags = NULL WHERE a.tags = 'Planes'\" command\r\n    Scenario: Remove single multivalue by index\r\n        Given I execute the \"UPDATE [nt:unstructured] AS a SET a.tags[0] = NULL WHERE a.tags = 'Planes'\" command\r\n    Scenario: Add a multivalue property\r\n        Given I execute the \"UPDATE [nt:unstructured] AS a SET a.tags = array_append(a.tags, 'Kite') WHERE a.tags = 'Planes'\" command\r\n    Scenario: Replace a multivalue property by index\r\n        Given I execute the \"UPDATE [nt:unstructured] AS a SET a.tags[1] = 'Kite', a.tags[2] = 'foobar' WHERE a.tags = 'Planes'\" command\r\n````","created_at":"2014-08-28T21:35:48Z","updated_at":"2014-10-08T10:48:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":"93720cbc608adecf82ac3cb0649d2eab92fa7b2c","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/phpcr/phpcr-shell/pulls/90/commits","review_comments_url":"https://api.github.com/repos/phpcr/phpcr-shell/pulls/90/comments","review_comment_url":"https://api.github.com/repos/phpcr/phpcr-shell/pulls/comments/{number}","comments_url":"https://api.github.com/repos/phpcr/phpcr-shell/issues/90/comments","statuses_url":"https://api.github.com/repos/phpcr/phpcr-shell/statuses/c60428f75429d1559ee13b49672b2b68687b9da7","head":{"label":"phpcr:update_query_indexes","ref":"update_query_indexes","sha":"c60428f75429d1559ee13b49672b2b68687b9da7","user":{"login":"phpcr","id":716851,"avatar_url":"https://avatars.githubusercontent.com/u/716851?v=2","gravatar_id":"","url":"https://api.github.com/users/phpcr","html_url":"https://github.com/phpcr","followers_url":"https://api.github.com/users/phpcr/followers","following_url":"https://api.github.com/users/phpcr/following{/other_user}","gists_url":"https://api.github.com/users/phpcr/gists{/gist_id}","starred_url":"https://api.github.com/users/phpcr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phpcr/subscriptions","organizations_url":"https://api.github.com/users/phpcr/orgs","repos_url":"https://api.github.com/users/phpcr/repos","events_url":"https://api.github.com/users/phpcr/events{/privacy}","received_events_url":"https://api.github.com/users/phpcr/received_events","type":"Organization","site_admin":false},"repo":{"id":14844492,"name":"phpcr-shell","full_name":"phpcr/phpcr-shell","owner":{"login":"phpcr","id":716851,"avatar_url":"https://avatars.githubusercontent.com/u/716851?v=2","gravatar_id":"","url":"https://api.github.com/users/phpcr","html_url":"https://github.com/phpcr","followers_url":"https://api.github.com/users/phpcr/followers","following_url":"https://api.github.com/users/phpcr/following{/other_user}","gists_url":"https://api.github.com/users/phpcr/gists{/gist_id}","starred_url":"https://api.github.com/users/phpcr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phpcr/subscriptions","organizations_url":"https://api.github.com/users/phpcr/orgs","repos_url":"https://api.github.com/users/phpcr/repos","events_url":"https://api.github.com/users/phpcr/events{/privacy}","received_events_url":"https://api.github.com/users/phpcr/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/phpcr/phpcr-shell","description":"PHPCR Shell","fork":false,"url":"https://api.github.com/repos/phpcr/phpcr-shell","forks_url":"https://api.github.com/repos/phpcr/phpcr-shell/forks","keys_url":"https://api.github.com/repos/phpcr/phpcr-shell/keys{/key_id}","collaborators_url":"https://api.github.com/repos/phpcr/phpcr-shell/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/phpcr/phpcr-shell/teams","hooks_url":"https://api.github.com/repos/phpcr/phpcr-shell/hooks","issue_events_url":"https://api.github.com/repos/phpcr/phpcr-shell/issues/events{/number}","events_url":"https://api.github.com/repos/phpcr/phpcr-shell/events","assignees_url":"https://api.github.com/repos/phpcr/phpcr-shell/assignees{/user}","branches_url":"https://api.github.com/repos/phpcr/phpcr-shell/branches{/branch}","tags_url":"https://api.github.com/repos/phpcr/phpcr-shell/tags","blobs_url":"https://api.github.com/repos/phpcr/phpcr-shell/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/phpcr/phpcr-shell/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/phpcr/phpcr-shell/git/refs{/sha}","trees_url":"https://api.github.com/repos/phpcr/phpcr-shell/git/trees{/sha}","statuses_url":"https://api.github.com/repos/phpcr/phpcr-shell/statuses/{sha}","languages_url":"https://api.github.com/repos/phpcr/phpcr-shell/languages","stargazers_url":"https://api.github.com/repos/phpcr/phpcr-shell/stargazers","contributors_url":"https://api.github.com/repos/phpcr/phpcr-shell/contributors","subscribers_url":"https://api.github.com/repos/phpcr/phpcr-shell/subscribers","subscription_url":"https://api.github.com/repos/phpcr/phpcr-shell/subscription","commits_url":"https://api.github.com/repos/phpcr/phpcr-shell/commits{/sha}","git_commits_url":"https://api.github.com/repos/phpcr/phpcr-shell/git/commits{/sha}","comments_url":"https://api.github.com/repos/phpcr/phpcr-shell/comments{/number}","issue_comment_url":"https://api.github.com/repos/phpcr/phpcr-shell/issues/comments/{number}","contents_url":"https://api.github.com/repos/phpcr/phpcr-shell/contents/{+path}","compare_url":"https://api.github.com/repos/phpcr/phpcr-shell/compare/{base}...{head}","merges_url":"https://api.github.com/repos/phpcr/phpcr-shell/merges","archive_url":"https://api.github.com/repos/phpcr/phpcr-shell/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/phpcr/phpcr-shell/downloads","issues_url":"https://api.github.com/repos/phpcr/phpcr-shell/issues{/number}","pulls_url":"https://api.github.com/repos/phpcr/phpcr-shell/pulls{/number}","milestones_url":"https://api.github.com/repos/phpcr/phpcr-shell/milestones{/number}","notifications_url":"https://api.github.com/repos/phpcr/phpcr-shell/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/phpcr/phpcr-shell/labels{/name}","releases_url":"https://api.github.com/repos/phpcr/phpcr-shell/releases{/id}","created_at":"2013-12-01T19:12:58Z","updated_at":"2014-09-07T05:54:34Z","pushed_at":"2014-10-08T06:23:14Z","git_url":"git://github.com/phpcr/phpcr-shell.git","ssh_url":"git@github.com:phpcr/phpcr-shell.git","clone_url":"https://github.com/phpcr/phpcr-shell.git","svn_url":"https://github.com/phpcr/phpcr-shell","homepage":null,"size":3958,"stargazers_count":19,"watchers_count":19,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6,"mirror_url":null,"open_issues_count":21,"forks":6,"open_issues":21,"watchers":19,"default_branch":"master"}},"base":{"label":"phpcr:master","ref":"master","sha":"0b35a4a19fe5512e0633db8e08cebfc97c996c1a","user":{"login":"phpcr","id":716851,"avatar_url":"https://avatars.githubusercontent.com/u/716851?v=2","gravatar_id":"","url":"https://api.github.com/users/phpcr","html_url":"https://github.com/phpcr","followers_url":"https://api.github.com/users/phpcr/followers","following_url":"https://api.github.com/users/phpcr/following{/other_user}","gists_url":"https://api.github.com/users/phpcr/gists{/gist_id}","starred_url":"https://api.github.com/users/phpcr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phpcr/subscriptions","organizations_url":"https://api.github.com/users/phpcr/orgs","repos_url":"https://api.github.com/users/phpcr/repos","events_url":"https://api.github.com/users/phpcr/events{/privacy}","received_events_url":"https://api.github.com/users/phpcr/received_events","type":"Organization","site_admin":false},"repo":{"id":14844492,"name":"phpcr-shell","full_name":"phpcr/phpcr-shell","owner":{"login":"phpcr","id":716851,"avatar_url":"https://avatars.githubusercontent.com/u/716851?v=2","gravatar_id":"","url":"https://api.github.com/users/phpcr","html_url":"https://github.com/phpcr","followers_url":"https://api.github.com/users/phpcr/followers","following_url":"https://api.github.com/users/phpcr/following{/other_user}","gists_url":"https://api.github.com/users/phpcr/gists{/gist_id}","starred_url":"https://api.github.com/users/phpcr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phpcr/subscriptions","organizations_url":"https://api.github.com/users/phpcr/orgs","repos_url":"https://api.github.com/users/phpcr/repos","events_url":"https://api.github.com/users/phpcr/events{/privacy}","received_events_url":"https://api.github.com/users/phpcr/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/phpcr/phpcr-shell","description":"PHPCR Shell","fork":false,"url":"https://api.github.com/repos/phpcr/phpcr-shell","forks_url":"https://api.github.com/repos/phpcr/phpcr-shell/forks","keys_url":"https://api.github.com/repos/phpcr/phpcr-shell/keys{/key_id}","collaborators_url":"https://api.github.com/repos/phpcr/phpcr-shell/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/phpcr/phpcr-shell/teams","hooks_url":"https://api.github.com/repos/phpcr/phpcr-shell/hooks","issue_events_url":"https://api.github.com/repos/phpcr/phpcr-shell/issues/events{/number}","events_url":"https://api.github.com/repos/phpcr/phpcr-shell/events","assignees_url":"https://api.github.com/repos/phpcr/phpcr-shell/assignees{/user}","branches_url":"https://api.github.com/repos/phpcr/phpcr-shell/branches{/branch}","tags_url":"https://api.github.com/repos/phpcr/phpcr-shell/tags","blobs_url":"https://api.github.com/repos/phpcr/phpcr-shell/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/phpcr/phpcr-shell/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/phpcr/phpcr-shell/git/refs{/sha}","trees_url":"https://api.github.com/repos/phpcr/phpcr-shell/git/trees{/sha}","statuses_url":"https://api.github.com/repos/phpcr/phpcr-shell/statuses/{sha}","languages_url":"https://api.github.com/repos/phpcr/phpcr-shell/languages","stargazers_url":"https://api.github.com/repos/phpcr/phpcr-shell/stargazers","contributors_url":"https://api.github.com/repos/phpcr/phpcr-shell/contributors","subscribers_url":"https://api.github.com/repos/phpcr/phpcr-shell/subscribers","subscription_url":"https://api.github.com/repos/phpcr/phpcr-shell/subscription","commits_url":"https://api.github.com/repos/phpcr/phpcr-shell/commits{/sha}","git_commits_url":"https://api.github.com/repos/phpcr/phpcr-shell/git/commits{/sha}","comments_url":"https://api.github.com/repos/phpcr/phpcr-shell/comments{/number}","issue_comment_url":"https://api.github.com/repos/phpcr/phpcr-shell/issues/comments/{number}","contents_url":"https://api.github.com/repos/phpcr/phpcr-shell/contents/{+path}","compare_url":"https://api.github.com/repos/phpcr/phpcr-shell/compare/{base}...{head}","merges_url":"https://api.github.com/repos/phpcr/phpcr-shell/merges","archive_url":"https://api.github.com/repos/phpcr/phpcr-shell/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/phpcr/phpcr-shell/downloads","issues_url":"https://api.github.com/repos/phpcr/phpcr-shell/issues{/number}","pulls_url":"https://api.github.com/repos/phpcr/phpcr-shell/pulls{/number}","milestones_url":"https://api.github.com/repos/phpcr/phpcr-shell/milestones{/number}","notifications_url":"https://api.github.com/repos/phpcr/phpcr-shell/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/phpcr/phpcr-shell/labels{/name}","releases_url":"https://api.github.com/repos/phpcr/phpcr-shell/releases{/id}","created_at":"2013-12-01T19:12:58Z","updated_at":"2014-09-07T05:54:34Z","pushed_at":"2014-10-08T06:23:14Z","git_url":"git://github.com/phpcr/phpcr-shell.git","ssh_url":"git@github.com:phpcr/phpcr-shell.git","clone_url":"https://github.com/phpcr/phpcr-shell.git","svn_url":"https://github.com/phpcr/phpcr-shell","homepage":null,"size":3958,"stargazers_count":19,"watchers_count":19,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6,"mirror_url":null,"open_issues_count":21,"forks":6,"open_issues":21,"watchers":19,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/phpcr/phpcr-shell/pulls/90"},"html":{"href":"https://github.com/phpcr/phpcr-shell/pull/90"},"issue":{"href":"https://api.github.com/repos/phpcr/phpcr-shell/issues/90"},"comments":{"href":"https://api.github.com/repos/phpcr/phpcr-shell/issues/90/comments"},"review_comments":{"href":"https://api.github.com/repos/phpcr/phpcr-shell/pulls/90/comments"},"review_comment":{"href":"https://api.github.com/repos/phpcr/phpcr-shell/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/phpcr/phpcr-shell/pulls/90/commits"},"statuses":{"href":"https://api.github.com/repos/phpcr/phpcr-shell/statuses/c60428f75429d1559ee13b49672b2b68687b9da7"}}}}