{"action":"created","comment":{"url":"https://api.github.com/repos/cakephp/docs/pulls/comments/70967241","id":70967241,"diff_hunk":"@@ -357,6 +357,33 @@ syntax::\n         }\n     }\n \n+Sometimes you may want to configure composite keys in your associations::\n+\n+    // Within ArticlesTable::initialize() call\n+    $this->hasMany('Reviews', [\n+        'foreignKey' => [\n+            'article_id',\n+            'article_hash'\n+        ]\n+    ]);\n+\n+In the example above, we have passed an array containing the desired composite\n+keys to ``foreignKey``. Maybe you need to specify different\n+binding fields than the defaults, so you can setup it manually in your\n+``bindingKeys`` array::\n+\n+    // Within ArticlesTable::initialize() call\n+    $this->hasMany('Reviews', [\n+        'foreignKey' => [\n+            'article_id',\n+            'article_hash'\n+        ],\n+        'bindingKey' => [\n+            'whatever_id',\n+            'whatever_hash'\n+        ]\n+    ]);","path":"en/orm/associations.rst","position":29,"original_position":29,"commit_id":"ca826e11c901e3450d7ba8782e7b592312e033c7","original_commit_id":"ca826e11c901e3450d7ba8782e7b592312e033c7","user":{"login":"andtxr","id":7216884,"avatar_url":"https://avatars.githubusercontent.com/u/7216884?v=3","gravatar_id":"","url":"https://api.github.com/users/andtxr","html_url":"https://github.com/andtxr","followers_url":"https://api.github.com/users/andtxr/followers","following_url":"https://api.github.com/users/andtxr/following{/other_user}","gists_url":"https://api.github.com/users/andtxr/gists{/gist_id}","starred_url":"https://api.github.com/users/andtxr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andtxr/subscriptions","organizations_url":"https://api.github.com/users/andtxr/orgs","repos_url":"https://api.github.com/users/andtxr/repos","events_url":"https://api.github.com/users/andtxr/events{/privacy}","received_events_url":"https://api.github.com/users/andtxr/received_events","type":"User","site_admin":false},"body":"I will send a new update today.","created_at":"2016-07-15T12:51:26Z","updated_at":"2016-07-15T12:51:26Z","html_url":"https://github.com/cakephp/docs/pull/4171#discussion_r70967241","pull_request_url":"https://api.github.com/repos/cakephp/docs/pulls/4171","_links":{"self":{"href":"https://api.github.com/repos/cakephp/docs/pulls/comments/70967241"},"html":{"href":"https://github.com/cakephp/docs/pull/4171#discussion_r70967241"},"pull_request":{"href":"https://api.github.com/repos/cakephp/docs/pulls/4171"}}},"pull_request":{"url":"https://api.github.com/repos/cakephp/docs/pulls/4171","id":77130764,"html_url":"https://github.com/cakephp/docs/pull/4171","diff_url":"https://github.com/cakephp/docs/pull/4171.diff","patch_url":"https://github.com/cakephp/docs/pull/4171.patch","issue_url":"https://api.github.com/repos/cakephp/docs/issues/4171","number":4171,"state":"open","locked":false,"title":"Adding missing composite keys example.","user":{"login":"andtxr","id":7216884,"avatar_url":"https://avatars.githubusercontent.com/u/7216884?v=3","gravatar_id":"","url":"https://api.github.com/users/andtxr","html_url":"https://github.com/andtxr","followers_url":"https://api.github.com/users/andtxr/followers","following_url":"https://api.github.com/users/andtxr/following{/other_user}","gists_url":"https://api.github.com/users/andtxr/gists{/gist_id}","starred_url":"https://api.github.com/users/andtxr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andtxr/subscriptions","organizations_url":"https://api.github.com/users/andtxr/orgs","repos_url":"https://api.github.com/users/andtxr/repos","events_url":"https://api.github.com/users/andtxr/events{/privacy}","received_events_url":"https://api.github.com/users/andtxr/received_events","type":"User","site_admin":false},"body":"Refers to #4051 \r\n\r\nFeel free to improve it if necessary. 👍 ","created_at":"2016-07-12T14:33:25Z","updated_at":"2016-07-15T12:51:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ad79cea6211098e8a448b3f8695803d9694f7774","assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/cakephp/docs/milestones/1","html_url":"https://github.com/cakephp/docs/milestones/3.x","labels_url":"https://api.github.com/repos/cakephp/docs/milestones/1/labels","id":629438,"number":1,"title":"3.x","description":"","creator":{"login":"markstory","id":24086,"avatar_url":"https://avatars.githubusercontent.com/u/24086?v=3","gravatar_id":"","url":"https://api.github.com/users/markstory","html_url":"https://github.com/markstory","followers_url":"https://api.github.com/users/markstory/followers","following_url":"https://api.github.com/users/markstory/following{/other_user}","gists_url":"https://api.github.com/users/markstory/gists{/gist_id}","starred_url":"https://api.github.com/users/markstory/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/markstory/subscriptions","organizations_url":"https://api.github.com/users/markstory/orgs","repos_url":"https://api.github.com/users/markstory/repos","events_url":"https://api.github.com/users/markstory/events{/privacy}","received_events_url":"https://api.github.com/users/markstory/received_events","type":"User","site_admin":false},"open_issues":31,"closed_issues":1786,"state":"open","created_at":"2014-04-14T15:44:13Z","updated_at":"2016-07-15T01:16:25Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/cakephp/docs/pulls/4171/commits","review_comments_url":"https://api.github.com/repos/cakephp/docs/pulls/4171/comments","review_comment_url":"https://api.github.com/repos/cakephp/docs/pulls/comments{/number}","comments_url":"https://api.github.com/repos/cakephp/docs/issues/4171/comments","statuses_url":"https://api.github.com/repos/cakephp/docs/statuses/ca826e11c901e3450d7ba8782e7b592312e033c7","head":{"label":"cakephp:composite-keys-example","ref":"composite-keys-example","sha":"ca826e11c901e3450d7ba8782e7b592312e033c7","user":{"login":"cakephp","id":23666,"avatar_url":"https://avatars.githubusercontent.com/u/23666?v=3","gravatar_id":"","url":"https://api.github.com/users/cakephp","html_url":"https://github.com/cakephp","followers_url":"https://api.github.com/users/cakephp/followers","following_url":"https://api.github.com/users/cakephp/following{/other_user}","gists_url":"https://api.github.com/users/cakephp/gists{/gist_id}","starred_url":"https://api.github.com/users/cakephp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cakephp/subscriptions","organizations_url":"https://api.github.com/users/cakephp/orgs","repos_url":"https://api.github.com/users/cakephp/repos","events_url":"https://api.github.com/users/cakephp/events{/privacy}","received_events_url":"https://api.github.com/users/cakephp/received_events","type":"Organization","site_admin":false},"repo":{"id":1514950,"name":"docs","full_name":"cakephp/docs","owner":{"login":"cakephp","id":23666,"avatar_url":"https://avatars.githubusercontent.com/u/23666?v=3","gravatar_id":"","url":"https://api.github.com/users/cakephp","html_url":"https://github.com/cakephp","followers_url":"https://api.github.com/users/cakephp/followers","following_url":"https://api.github.com/users/cakephp/following{/other_user}","gists_url":"https://api.github.com/users/cakephp/gists{/gist_id}","starred_url":"https://api.github.com/users/cakephp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cakephp/subscriptions","organizations_url":"https://api.github.com/users/cakephp/orgs","repos_url":"https://api.github.com/users/cakephp/repos","events_url":"https://api.github.com/users/cakephp/events{/privacy}","received_events_url":"https://api.github.com/users/cakephp/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/cakephp/docs","description":"CakePHP CookBook","fork":false,"url":"https://api.github.com/repos/cakephp/docs","forks_url":"https://api.github.com/repos/cakephp/docs/forks","keys_url":"https://api.github.com/repos/cakephp/docs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cakephp/docs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cakephp/docs/teams","hooks_url":"https://api.github.com/repos/cakephp/docs/hooks","issue_events_url":"https://api.github.com/repos/cakephp/docs/issues/events{/number}","events_url":"https://api.github.com/repos/cakephp/docs/events","assignees_url":"https://api.github.com/repos/cakephp/docs/assignees{/user}","branches_url":"https://api.github.com/repos/cakephp/docs/branches{/branch}","tags_url":"https://api.github.com/repos/cakephp/docs/tags","blobs_url":"https://api.github.com/repos/cakephp/docs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cakephp/docs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cakephp/docs/git/refs{/sha}","trees_url":"https://api.github.com/repos/cakephp/docs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cakephp/docs/statuses/{sha}","languages_url":"https://api.github.com/repos/cakephp/docs/languages","stargazers_url":"https://api.github.com/repos/cakephp/docs/stargazers","contributors_url":"https://api.github.com/repos/cakephp/docs/contributors","subscribers_url":"https://api.github.com/repos/cakephp/docs/subscribers","subscription_url":"https://api.github.com/repos/cakephp/docs/subscription","commits_url":"https://api.github.com/repos/cakephp/docs/commits{/sha}","git_commits_url":"https://api.github.com/repos/cakephp/docs/git/commits{/sha}","comments_url":"https://api.github.com/repos/cakephp/docs/comments{/number}","issue_comment_url":"https://api.github.com/repos/cakephp/docs/issues/comments{/number}","contents_url":"https://api.github.com/repos/cakephp/docs/contents/{+path}","compare_url":"https://api.github.com/repos/cakephp/docs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cakephp/docs/merges","archive_url":"https://api.github.com/repos/cakephp/docs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cakephp/docs/downloads","issues_url":"https://api.github.com/repos/cakephp/docs/issues{/number}","pulls_url":"https://api.github.com/repos/cakephp/docs/pulls{/number}","milestones_url":"https://api.github.com/repos/cakephp/docs/milestones{/number}","notifications_url":"https://api.github.com/repos/cakephp/docs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cakephp/docs/labels{/name}","releases_url":"https://api.github.com/repos/cakephp/docs/releases{/id}","deployments_url":"https://api.github.com/repos/cakephp/docs/deployments","created_at":"2011-03-23T04:54:13Z","updated_at":"2016-07-15T07:10:29Z","pushed_at":"2016-07-15T01:16:26Z","git_url":"git://github.com/cakephp/docs.git","ssh_url":"git@github.com:cakephp/docs.git","clone_url":"https://github.com/cakephp/docs.git","svn_url":"https://github.com/cakephp/docs","homepage":"http://book.cakephp.org","size":54941,"stargazers_count":530,"watchers_count":530,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":2102,"mirror_url":null,"open_issues_count":43,"forks":2102,"open_issues":43,"watchers":530,"default_branch":"master"}},"base":{"label":"cakephp:3.0","ref":"3.0","sha":"b808fe7102481225a8cc99aefd2d6c20bb9fdf64","user":{"login":"cakephp","id":23666,"avatar_url":"https://avatars.githubusercontent.com/u/23666?v=3","gravatar_id":"","url":"https://api.github.com/users/cakephp","html_url":"https://github.com/cakephp","followers_url":"https://api.github.com/users/cakephp/followers","following_url":"https://api.github.com/users/cakephp/following{/other_user}","gists_url":"https://api.github.com/users/cakephp/gists{/gist_id}","starred_url":"https://api.github.com/users/cakephp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cakephp/subscriptions","organizations_url":"https://api.github.com/users/cakephp/orgs","repos_url":"https://api.github.com/users/cakephp/repos","events_url":"https://api.github.com/users/cakephp/events{/privacy}","received_events_url":"https://api.github.com/users/cakephp/received_events","type":"Organization","site_admin":false},"repo":{"id":1514950,"name":"docs","full_name":"cakephp/docs","owner":{"login":"cakephp","id":23666,"avatar_url":"https://avatars.githubusercontent.com/u/23666?v=3","gravatar_id":"","url":"https://api.github.com/users/cakephp","html_url":"https://github.com/cakephp","followers_url":"https://api.github.com/users/cakephp/followers","following_url":"https://api.github.com/users/cakephp/following{/other_user}","gists_url":"https://api.github.com/users/cakephp/gists{/gist_id}","starred_url":"https://api.github.com/users/cakephp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cakephp/subscriptions","organizations_url":"https://api.github.com/users/cakephp/orgs","repos_url":"https://api.github.com/users/cakephp/repos","events_url":"https://api.github.com/users/cakephp/events{/privacy}","received_events_url":"https://api.github.com/users/cakephp/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/cakephp/docs","description":"CakePHP CookBook","fork":false,"url":"https://api.github.com/repos/cakephp/docs","forks_url":"https://api.github.com/repos/cakephp/docs/forks","keys_url":"https://api.github.com/repos/cakephp/docs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cakephp/docs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cakephp/docs/teams","hooks_url":"https://api.github.com/repos/cakephp/docs/hooks","issue_events_url":"https://api.github.com/repos/cakephp/docs/issues/events{/number}","events_url":"https://api.github.com/repos/cakephp/docs/events","assignees_url":"https://api.github.com/repos/cakephp/docs/assignees{/user}","branches_url":"https://api.github.com/repos/cakephp/docs/branches{/branch}","tags_url":"https://api.github.com/repos/cakephp/docs/tags","blobs_url":"https://api.github.com/repos/cakephp/docs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cakephp/docs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cakephp/docs/git/refs{/sha}","trees_url":"https://api.github.com/repos/cakephp/docs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cakephp/docs/statuses/{sha}","languages_url":"https://api.github.com/repos/cakephp/docs/languages","stargazers_url":"https://api.github.com/repos/cakephp/docs/stargazers","contributors_url":"https://api.github.com/repos/cakephp/docs/contributors","subscribers_url":"https://api.github.com/repos/cakephp/docs/subscribers","subscription_url":"https://api.github.com/repos/cakephp/docs/subscription","commits_url":"https://api.github.com/repos/cakephp/docs/commits{/sha}","git_commits_url":"https://api.github.com/repos/cakephp/docs/git/commits{/sha}","comments_url":"https://api.github.com/repos/cakephp/docs/comments{/number}","issue_comment_url":"https://api.github.com/repos/cakephp/docs/issues/comments{/number}","contents_url":"https://api.github.com/repos/cakephp/docs/contents/{+path}","compare_url":"https://api.github.com/repos/cakephp/docs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cakephp/docs/merges","archive_url":"https://api.github.com/repos/cakephp/docs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cakephp/docs/downloads","issues_url":"https://api.github.com/repos/cakephp/docs/issues{/number}","pulls_url":"https://api.github.com/repos/cakephp/docs/pulls{/number}","milestones_url":"https://api.github.com/repos/cakephp/docs/milestones{/number}","notifications_url":"https://api.github.com/repos/cakephp/docs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cakephp/docs/labels{/name}","releases_url":"https://api.github.com/repos/cakephp/docs/releases{/id}","deployments_url":"https://api.github.com/repos/cakephp/docs/deployments","created_at":"2011-03-23T04:54:13Z","updated_at":"2016-07-15T07:10:29Z","pushed_at":"2016-07-15T01:16:26Z","git_url":"git://github.com/cakephp/docs.git","ssh_url":"git@github.com:cakephp/docs.git","clone_url":"https://github.com/cakephp/docs.git","svn_url":"https://github.com/cakephp/docs","homepage":"http://book.cakephp.org","size":54941,"stargazers_count":530,"watchers_count":530,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":2102,"mirror_url":null,"open_issues_count":43,"forks":2102,"open_issues":43,"watchers":530,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/cakephp/docs/pulls/4171"},"html":{"href":"https://github.com/cakephp/docs/pull/4171"},"issue":{"href":"https://api.github.com/repos/cakephp/docs/issues/4171"},"comments":{"href":"https://api.github.com/repos/cakephp/docs/issues/4171/comments"},"review_comments":{"href":"https://api.github.com/repos/cakephp/docs/pulls/4171/comments"},"review_comment":{"href":"https://api.github.com/repos/cakephp/docs/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/cakephp/docs/pulls/4171/commits"},"statuses":{"href":"https://api.github.com/repos/cakephp/docs/statuses/ca826e11c901e3450d7ba8782e7b592312e033c7"}}}}
{"actor":{"display_login":"andtxr"}}