{"action":"created","comment":{"url":"https://api.github.com/repos/superdesk/contentapi-sdk-php/pulls/comments/42852614","id":42852614,"diff_hunk":"@@ -174,16 +174,26 @@ private function getAssociationsFromPackage(Package $package)\n         $associations = new stdClass();\n \n         if (isset($package->associations)) {\n-            foreach ($package->associations as $associatedName => $associatedItem) {\n-                $associatedId = $this->getIdFromUri($associatedItem->uri);\n+            foreach ($package->associations as $associationGroupName => $associationGroupItems) {\n \n-                if ($associatedItem->type == 'composite') {\n-                    $associatedObj = $this->getPackage($associatedId, true);\n-                } else {\n-                    $associatedObj = $this->getItem($associatedId);\n+                $groupAssociations = new stdClass();\n+\n+                foreach ($associationGroupItems AS $associatedName => $associatedItem) {\n+                    $associatedId = $this->getIdFromUri($associatedItem->uri);\n+\n+                    if ($associatedItem->type == 'picture') continue;","path":"src/Superdesk/ContentApiSdk/ContentApiSdk.php","position":25,"original_position":17,"commit_id":"ad51c918c7dcbdab27801b47a1a6b1f65d35beed","original_commit_id":"0c6b1ad800fcf288e10005ede829eba8a84f4a09","user":{"login":"m038","id":164319,"avatar_url":"https://avatars.githubusercontent.com/u/164319?v=3","gravatar_id":"","url":"https://api.github.com/users/m038","html_url":"https://github.com/m038","followers_url":"https://api.github.com/users/m038/followers","following_url":"https://api.github.com/users/m038/following{/other_user}","gists_url":"https://api.github.com/users/m038/gists{/gist_id}","starred_url":"https://api.github.com/users/m038/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/m038/subscriptions","organizations_url":"https://api.github.com/users/m038/orgs","repos_url":"https://api.github.com/users/m038/repos","events_url":"https://api.github.com/users/m038/events{/privacy}","received_events_url":"https://api.github.com/users/m038/received_events","type":"User","site_admin":false},"body":"I'll leave this for now, since it's only there since the picture output is still broken. Probably will remove it once it's fixed.","created_at":"2015-10-23T10:44:48Z","updated_at":"2015-10-23T10:44:48Z","html_url":"https://github.com/superdesk/contentapi-sdk-php/pull/9#discussion_r42852614","pull_request_url":"https://api.github.com/repos/superdesk/contentapi-sdk-php/pulls/9","_links":{"self":{"href":"https://api.github.com/repos/superdesk/contentapi-sdk-php/pulls/comments/42852614"},"html":{"href":"https://github.com/superdesk/contentapi-sdk-php/pull/9#discussion_r42852614"},"pull_request":{"href":"https://api.github.com/repos/superdesk/contentapi-sdk-php/pulls/9"}}},"pull_request":{"url":"https://api.github.com/repos/superdesk/contentapi-sdk-php/pulls/9","id":48564897,"html_url":"https://github.com/superdesk/contentapi-sdk-php/pull/9","diff_url":"https://github.com/superdesk/contentapi-sdk-php/pull/9.diff","patch_url":"https://github.com/superdesk/contentapi-sdk-php/pull/9.patch","issue_url":"https://api.github.com/repos/superdesk/contentapi-sdk-php/issues/9","number":9,"state":"open","locked":false,"title":"[wip] Updates for association handling","user":{"login":"m038","id":164319,"avatar_url":"https://avatars.githubusercontent.com/u/164319?v=3","gravatar_id":"","url":"https://api.github.com/users/m038","html_url":"https://github.com/m038","followers_url":"https://api.github.com/users/m038/followers","following_url":"https://api.github.com/users/m038/following{/other_user}","gists_url":"https://api.github.com/users/m038/gists{/gist_id}","starred_url":"https://api.github.com/users/m038/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/m038/subscriptions","organizations_url":"https://api.github.com/users/m038/orgs","repos_url":"https://api.github.com/users/m038/repos","events_url":"https://api.github.com/users/m038/events{/privacy}","received_events_url":"https://api.github.com/users/m038/received_events","type":"User","site_admin":false},"body":"Adds support for association categories and fixes item type\r\n\r\nThe item type, when fully resolved from a package, will be set to the\r\nsame value as the value of the relation type between a package and an\r\nitem.\r\n","created_at":"2015-10-23T10:36:03Z","updated_at":"2015-10-23T10:44:48Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1ced311cbe8b91b8c95d819561874415bc67c7f5","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/superdesk/contentapi-sdk-php/pulls/9/commits","review_comments_url":"https://api.github.com/repos/superdesk/contentapi-sdk-php/pulls/9/comments","review_comment_url":"https://api.github.com/repos/superdesk/contentapi-sdk-php/pulls/comments{/number}","comments_url":"https://api.github.com/repos/superdesk/contentapi-sdk-php/issues/9/comments","statuses_url":"https://api.github.com/repos/superdesk/contentapi-sdk-php/statuses/ad51c918c7dcbdab27801b47a1a6b1f65d35beed","head":{"label":"m038:master","ref":"master","sha":"ad51c918c7dcbdab27801b47a1a6b1f65d35beed","user":{"login":"m038","id":164319,"avatar_url":"https://avatars.githubusercontent.com/u/164319?v=3","gravatar_id":"","url":"https://api.github.com/users/m038","html_url":"https://github.com/m038","followers_url":"https://api.github.com/users/m038/followers","following_url":"https://api.github.com/users/m038/following{/other_user}","gists_url":"https://api.github.com/users/m038/gists{/gist_id}","starred_url":"https://api.github.com/users/m038/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/m038/subscriptions","organizations_url":"https://api.github.com/users/m038/orgs","repos_url":"https://api.github.com/users/m038/repos","events_url":"https://api.github.com/users/m038/events{/privacy}","received_events_url":"https://api.github.com/users/m038/received_events","type":"User","site_admin":false},"repo":{"id":40130217,"name":"contentapi-sdk-php","full_name":"m038/contentapi-sdk-php","owner":{"login":"m038","id":164319,"avatar_url":"https://avatars.githubusercontent.com/u/164319?v=3","gravatar_id":"","url":"https://api.github.com/users/m038","html_url":"https://github.com/m038","followers_url":"https://api.github.com/users/m038/followers","following_url":"https://api.github.com/users/m038/following{/other_user}","gists_url":"https://api.github.com/users/m038/gists{/gist_id}","starred_url":"https://api.github.com/users/m038/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/m038/subscriptions","organizations_url":"https://api.github.com/users/m038/orgs","repos_url":"https://api.github.com/users/m038/repos","events_url":"https://api.github.com/users/m038/events{/privacy}","received_events_url":"https://api.github.com/users/m038/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/m038/contentapi-sdk-php","description":"PHP SDK for Superdesk Content API","fork":true,"url":"https://api.github.com/repos/m038/contentapi-sdk-php","forks_url":"https://api.github.com/repos/m038/contentapi-sdk-php/forks","keys_url":"https://api.github.com/repos/m038/contentapi-sdk-php/keys{/key_id}","collaborators_url":"https://api.github.com/repos/m038/contentapi-sdk-php/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/m038/contentapi-sdk-php/teams","hooks_url":"https://api.github.com/repos/m038/contentapi-sdk-php/hooks","issue_events_url":"https://api.github.com/repos/m038/contentapi-sdk-php/issues/events{/number}","events_url":"https://api.github.com/repos/m038/contentapi-sdk-php/events","assignees_url":"https://api.github.com/repos/m038/contentapi-sdk-php/assignees{/user}","branches_url":"https://api.github.com/repos/m038/contentapi-sdk-php/branches{/branch}","tags_url":"https://api.github.com/repos/m038/contentapi-sdk-php/tags","blobs_url":"https://api.github.com/repos/m038/contentapi-sdk-php/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/m038/contentapi-sdk-php/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/m038/contentapi-sdk-php/git/refs{/sha}","trees_url":"https://api.github.com/repos/m038/contentapi-sdk-php/git/trees{/sha}","statuses_url":"https://api.github.com/repos/m038/contentapi-sdk-php/statuses/{sha}","languages_url":"https://api.github.com/repos/m038/contentapi-sdk-php/languages","stargazers_url":"https://api.github.com/repos/m038/contentapi-sdk-php/stargazers","contributors_url":"https://api.github.com/repos/m038/contentapi-sdk-php/contributors","subscribers_url":"https://api.github.com/repos/m038/contentapi-sdk-php/subscribers","subscription_url":"https://api.github.com/repos/m038/contentapi-sdk-php/subscription","commits_url":"https://api.github.com/repos/m038/contentapi-sdk-php/commits{/sha}","git_commits_url":"https://api.github.com/repos/m038/contentapi-sdk-php/git/commits{/sha}","comments_url":"https://api.github.com/repos/m038/contentapi-sdk-php/comments{/number}","issue_comment_url":"https://api.github.com/repos/m038/contentapi-sdk-php/issues/comments{/number}","contents_url":"https://api.github.com/repos/m038/contentapi-sdk-php/contents/{+path}","compare_url":"https://api.github.com/repos/m038/contentapi-sdk-php/compare/{base}...{head}","merges_url":"https://api.github.com/repos/m038/contentapi-sdk-php/merges","archive_url":"https://api.github.com/repos/m038/contentapi-sdk-php/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/m038/contentapi-sdk-php/downloads","issues_url":"https://api.github.com/repos/m038/contentapi-sdk-php/issues{/number}","pulls_url":"https://api.github.com/repos/m038/contentapi-sdk-php/pulls{/number}","milestones_url":"https://api.github.com/repos/m038/contentapi-sdk-php/milestones{/number}","notifications_url":"https://api.github.com/repos/m038/contentapi-sdk-php/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/m038/contentapi-sdk-php/labels{/name}","releases_url":"https://api.github.com/repos/m038/contentapi-sdk-php/releases{/id}","created_at":"2015-08-03T14:47:44Z","updated_at":"2015-08-03T14:51:39Z","pushed_at":"2015-10-23T10:43:55Z","git_url":"git://github.com/m038/contentapi-sdk-php.git","ssh_url":"git@github.com:m038/contentapi-sdk-php.git","clone_url":"https://github.com/m038/contentapi-sdk-php.git","svn_url":"https://github.com/m038/contentapi-sdk-php","homepage":null,"size":199,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"superdesk:master","ref":"master","sha":"e39845b7448f74bbd4384ca780208ff0148e727d","user":{"login":"superdesk","id":5527298,"avatar_url":"https://avatars.githubusercontent.com/u/5527298?v=3","gravatar_id":"","url":"https://api.github.com/users/superdesk","html_url":"https://github.com/superdesk","followers_url":"https://api.github.com/users/superdesk/followers","following_url":"https://api.github.com/users/superdesk/following{/other_user}","gists_url":"https://api.github.com/users/superdesk/gists{/gist_id}","starred_url":"https://api.github.com/users/superdesk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/superdesk/subscriptions","organizations_url":"https://api.github.com/users/superdesk/orgs","repos_url":"https://api.github.com/users/superdesk/repos","events_url":"https://api.github.com/users/superdesk/events{/privacy}","received_events_url":"https://api.github.com/users/superdesk/received_events","type":"Organization","site_admin":false},"repo":{"id":39943249,"name":"contentapi-sdk-php","full_name":"superdesk/contentapi-sdk-php","owner":{"login":"superdesk","id":5527298,"avatar_url":"https://avatars.githubusercontent.com/u/5527298?v=3","gravatar_id":"","url":"https://api.github.com/users/superdesk","html_url":"https://github.com/superdesk","followers_url":"https://api.github.com/users/superdesk/followers","following_url":"https://api.github.com/users/superdesk/following{/other_user}","gists_url":"https://api.github.com/users/superdesk/gists{/gist_id}","starred_url":"https://api.github.com/users/superdesk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/superdesk/subscriptions","organizations_url":"https://api.github.com/users/superdesk/orgs","repos_url":"https://api.github.com/users/superdesk/repos","events_url":"https://api.github.com/users/superdesk/events{/privacy}","received_events_url":"https://api.github.com/users/superdesk/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/superdesk/contentapi-sdk-php","description":"PHP SDK for Superdesk Content API","fork":false,"url":"https://api.github.com/repos/superdesk/contentapi-sdk-php","forks_url":"https://api.github.com/repos/superdesk/contentapi-sdk-php/forks","keys_url":"https://api.github.com/repos/superdesk/contentapi-sdk-php/keys{/key_id}","collaborators_url":"https://api.github.com/repos/superdesk/contentapi-sdk-php/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/superdesk/contentapi-sdk-php/teams","hooks_url":"https://api.github.com/repos/superdesk/contentapi-sdk-php/hooks","issue_events_url":"https://api.github.com/repos/superdesk/contentapi-sdk-php/issues/events{/number}","events_url":"https://api.github.com/repos/superdesk/contentapi-sdk-php/events","assignees_url":"https://api.github.com/repos/superdesk/contentapi-sdk-php/assignees{/user}","branches_url":"https://api.github.com/repos/superdesk/contentapi-sdk-php/branches{/branch}","tags_url":"https://api.github.com/repos/superdesk/contentapi-sdk-php/tags","blobs_url":"https://api.github.com/repos/superdesk/contentapi-sdk-php/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/superdesk/contentapi-sdk-php/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/superdesk/contentapi-sdk-php/git/refs{/sha}","trees_url":"https://api.github.com/repos/superdesk/contentapi-sdk-php/git/trees{/sha}","statuses_url":"https://api.github.com/repos/superdesk/contentapi-sdk-php/statuses/{sha}","languages_url":"https://api.github.com/repos/superdesk/contentapi-sdk-php/languages","stargazers_url":"https://api.github.com/repos/superdesk/contentapi-sdk-php/stargazers","contributors_url":"https://api.github.com/repos/superdesk/contentapi-sdk-php/contributors","subscribers_url":"https://api.github.com/repos/superdesk/contentapi-sdk-php/subscribers","subscription_url":"https://api.github.com/repos/superdesk/contentapi-sdk-php/subscription","commits_url":"https://api.github.com/repos/superdesk/contentapi-sdk-php/commits{/sha}","git_commits_url":"https://api.github.com/repos/superdesk/contentapi-sdk-php/git/commits{/sha}","comments_url":"https://api.github.com/repos/superdesk/contentapi-sdk-php/comments{/number}","issue_comment_url":"https://api.github.com/repos/superdesk/contentapi-sdk-php/issues/comments{/number}","contents_url":"https://api.github.com/repos/superdesk/contentapi-sdk-php/contents/{+path}","compare_url":"https://api.github.com/repos/superdesk/contentapi-sdk-php/compare/{base}...{head}","merges_url":"https://api.github.com/repos/superdesk/contentapi-sdk-php/merges","archive_url":"https://api.github.com/repos/superdesk/contentapi-sdk-php/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/superdesk/contentapi-sdk-php/downloads","issues_url":"https://api.github.com/repos/superdesk/contentapi-sdk-php/issues{/number}","pulls_url":"https://api.github.com/repos/superdesk/contentapi-sdk-php/pulls{/number}","milestones_url":"https://api.github.com/repos/superdesk/contentapi-sdk-php/milestones{/number}","notifications_url":"https://api.github.com/repos/superdesk/contentapi-sdk-php/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/superdesk/contentapi-sdk-php/labels{/name}","releases_url":"https://api.github.com/repos/superdesk/contentapi-sdk-php/releases{/id}","created_at":"2015-07-30T09:46:23Z","updated_at":"2015-08-18T12:21:06Z","pushed_at":"2015-10-23T10:43:56Z","git_url":"git://github.com/superdesk/contentapi-sdk-php.git","ssh_url":"git@github.com:superdesk/contentapi-sdk-php.git","clone_url":"https://github.com/superdesk/contentapi-sdk-php.git","svn_url":"https://github.com/superdesk/contentapi-sdk-php","homepage":null,"size":283,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":1,"forks":2,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/superdesk/contentapi-sdk-php/pulls/9"},"html":{"href":"https://github.com/superdesk/contentapi-sdk-php/pull/9"},"issue":{"href":"https://api.github.com/repos/superdesk/contentapi-sdk-php/issues/9"},"comments":{"href":"https://api.github.com/repos/superdesk/contentapi-sdk-php/issues/9/comments"},"review_comments":{"href":"https://api.github.com/repos/superdesk/contentapi-sdk-php/pulls/9/comments"},"review_comment":{"href":"https://api.github.com/repos/superdesk/contentapi-sdk-php/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/superdesk/contentapi-sdk-php/pulls/9/commits"},"statuses":{"href":"https://api.github.com/repos/superdesk/contentapi-sdk-php/statuses/ad51c918c7dcbdab27801b47a1a6b1f65d35beed"}}}}