{"action":"created","comment":{"url":"https://api.github.com/repos/cakephp/cakephp/pulls/comments/42596231","id":42596231,"diff_hunk":"@@ -71,17 +79,24 @@ protected function _setModelClass($name)\n      * be thrown.\n      *\n      * @param string|null $modelClass Name of model class to load. Defaults to $this->modelClass\n-     * @param string $type The type of repository to load. Defaults to 'Table' which\n-     *   delegates to Cake\\ORM\\TableRegistry.\n+     * @param string|null $modelType The type of repository to load. Defaults to the modelType() value.\n      * @return object The model instance created.\n      * @throws \\Cake\\Datasource\\Exception\\MissingModelException If the model class cannot be found.\n      * @throws \\InvalidArgumentException When using a type that has not been registered.\n+     * @throws \\UnexpectedValueException If no model type has been defined\n      */\n-    public function loadModel($modelClass = null, $type = 'Table')\n+    public function loadModel($modelClass = null, $modelType = null)\n     {\n         if ($modelClass === null) {\n             $modelClass = $this->modelClass;\n         }\n+        if ($modelType === null) {\n+            $modelType = $this->modelType();\n+\n+            if ($modelType === null) {\n+                throw new UnexpectedValueException(sprintf('No model type has been defined'));","path":"src/Datasource/ModelAwareTrait.php","position":null,"original_position":44,"commit_id":"dff20b7a4ecb71ccb9f7b1a0e0b908517e940878","original_commit_id":"2c347e9440e3897a1b843baa3221501e8b85e0d8","user":{"login":"Marlinc","id":1240253,"avatar_url":"https://avatars.githubusercontent.com/u/1240253?v=3","gravatar_id":"","url":"https://api.github.com/users/Marlinc","html_url":"https://github.com/Marlinc","followers_url":"https://api.github.com/users/Marlinc/followers","following_url":"https://api.github.com/users/Marlinc/following{/other_user}","gists_url":"https://api.github.com/users/Marlinc/gists{/gist_id}","starred_url":"https://api.github.com/users/Marlinc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Marlinc/subscriptions","organizations_url":"https://api.github.com/users/Marlinc/orgs","repos_url":"https://api.github.com/users/Marlinc/repos","events_url":"https://api.github.com/users/Marlinc/events{/privacy}","received_events_url":"https://api.github.com/users/Marlinc/received_events","type":"User","site_admin":false},"body":"You're right, I've fixed it :+1: ","created_at":"2015-10-21T08:34:02Z","updated_at":"2015-10-21T08:34:02Z","html_url":"https://github.com/cakephp/cakephp/pull/7587#discussion_r42596231","pull_request_url":"https://api.github.com/repos/cakephp/cakephp/pulls/7587","_links":{"self":{"href":"https://api.github.com/repos/cakephp/cakephp/pulls/comments/42596231"},"html":{"href":"https://github.com/cakephp/cakephp/pull/7587#discussion_r42596231"},"pull_request":{"href":"https://api.github.com/repos/cakephp/cakephp/pulls/7587"}}},"pull_request":{"url":"https://api.github.com/repos/cakephp/cakephp/pulls/7587","id":48242827,"html_url":"https://github.com/cakephp/cakephp/pull/7587","diff_url":"https://github.com/cakephp/cakephp/pull/7587.diff","patch_url":"https://github.com/cakephp/cakephp/pull/7587.patch","issue_url":"https://api.github.com/repos/cakephp/cakephp/issues/7587","number":7587,"state":"open","locked":false,"title":"Add the ability to set the default model type","user":{"login":"Marlinc","id":1240253,"avatar_url":"https://avatars.githubusercontent.com/u/1240253?v=3","gravatar_id":"","url":"https://api.github.com/users/Marlinc","html_url":"https://github.com/Marlinc","followers_url":"https://api.github.com/users/Marlinc/followers","following_url":"https://api.github.com/users/Marlinc/following{/other_user}","gists_url":"https://api.github.com/users/Marlinc/gists{/gist_id}","starred_url":"https://api.github.com/users/Marlinc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Marlinc/subscriptions","organizations_url":"https://api.github.com/users/Marlinc/orgs","repos_url":"https://api.github.com/users/Marlinc/repos","events_url":"https://api.github.com/users/Marlinc/events{/privacy}","received_events_url":"https://api.github.com/users/Marlinc/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-10-20T18:58:25Z","updated_at":"2015-10-21T08:34:02Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f530af3fe32c05fc357c0e51df46c9395c92b7ae","assignee":null,"milestone":{"url":"https://api.github.com/repos/cakephp/cakephp/milestones/64","html_url":"https://github.com/cakephp/cakephp/milestones/3.1.3","labels_url":"https://api.github.com/repos/cakephp/cakephp/milestones/64/labels","id":1362733,"number":64,"title":"3.1.3","description":"Bugfixes and minor features for the 3.1.x release branch","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":26,"closed_issues":7,"state":"open","created_at":"2015-10-19T01:08:03Z","updated_at":"2015-10-21T08:18:13Z","due_on":"2015-11-01T04:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/cakephp/cakephp/pulls/7587/commits","review_comments_url":"https://api.github.com/repos/cakephp/cakephp/pulls/7587/comments","review_comment_url":"https://api.github.com/repos/cakephp/cakephp/pulls/comments{/number}","comments_url":"https://api.github.com/repos/cakephp/cakephp/issues/7587/comments","statuses_url":"https://api.github.com/repos/cakephp/cakephp/statuses/dff20b7a4ecb71ccb9f7b1a0e0b908517e940878","head":{"label":"cvo-technologies:feature-model-aware-type","ref":"feature-model-aware-type","sha":"dff20b7a4ecb71ccb9f7b1a0e0b908517e940878","user":{"login":"cvo-technologies","id":1243867,"avatar_url":"https://avatars.githubusercontent.com/u/1243867?v=3","gravatar_id":"","url":"https://api.github.com/users/cvo-technologies","html_url":"https://github.com/cvo-technologies","followers_url":"https://api.github.com/users/cvo-technologies/followers","following_url":"https://api.github.com/users/cvo-technologies/following{/other_user}","gists_url":"https://api.github.com/users/cvo-technologies/gists{/gist_id}","starred_url":"https://api.github.com/users/cvo-technologies/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cvo-technologies/subscriptions","organizations_url":"https://api.github.com/users/cvo-technologies/orgs","repos_url":"https://api.github.com/users/cvo-technologies/repos","events_url":"https://api.github.com/users/cvo-technologies/events{/privacy}","received_events_url":"https://api.github.com/users/cvo-technologies/received_events","type":"Organization","site_admin":false},"repo":{"id":19697328,"name":"cakephp","full_name":"cvo-technologies/cakephp","owner":{"login":"cvo-technologies","id":1243867,"avatar_url":"https://avatars.githubusercontent.com/u/1243867?v=3","gravatar_id":"","url":"https://api.github.com/users/cvo-technologies","html_url":"https://github.com/cvo-technologies","followers_url":"https://api.github.com/users/cvo-technologies/followers","following_url":"https://api.github.com/users/cvo-technologies/following{/other_user}","gists_url":"https://api.github.com/users/cvo-technologies/gists{/gist_id}","starred_url":"https://api.github.com/users/cvo-technologies/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cvo-technologies/subscriptions","organizations_url":"https://api.github.com/users/cvo-technologies/orgs","repos_url":"https://api.github.com/users/cvo-technologies/repos","events_url":"https://api.github.com/users/cvo-technologies/events{/privacy}","received_events_url":"https://api.github.com/users/cvo-technologies/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/cvo-technologies/cakephp","description":"CakePHP: The Rapid Development Framework for PHP - Official Repository","fork":true,"url":"https://api.github.com/repos/cvo-technologies/cakephp","forks_url":"https://api.github.com/repos/cvo-technologies/cakephp/forks","keys_url":"https://api.github.com/repos/cvo-technologies/cakephp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cvo-technologies/cakephp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cvo-technologies/cakephp/teams","hooks_url":"https://api.github.com/repos/cvo-technologies/cakephp/hooks","issue_events_url":"https://api.github.com/repos/cvo-technologies/cakephp/issues/events{/number}","events_url":"https://api.github.com/repos/cvo-technologies/cakephp/events","assignees_url":"https://api.github.com/repos/cvo-technologies/cakephp/assignees{/user}","branches_url":"https://api.github.com/repos/cvo-technologies/cakephp/branches{/branch}","tags_url":"https://api.github.com/repos/cvo-technologies/cakephp/tags","blobs_url":"https://api.github.com/repos/cvo-technologies/cakephp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cvo-technologies/cakephp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cvo-technologies/cakephp/git/refs{/sha}","trees_url":"https://api.github.com/repos/cvo-technologies/cakephp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cvo-technologies/cakephp/statuses/{sha}","languages_url":"https://api.github.com/repos/cvo-technologies/cakephp/languages","stargazers_url":"https://api.github.com/repos/cvo-technologies/cakephp/stargazers","contributors_url":"https://api.github.com/repos/cvo-technologies/cakephp/contributors","subscribers_url":"https://api.github.com/repos/cvo-technologies/cakephp/subscribers","subscription_url":"https://api.github.com/repos/cvo-technologies/cakephp/subscription","commits_url":"https://api.github.com/repos/cvo-technologies/cakephp/commits{/sha}","git_commits_url":"https://api.github.com/repos/cvo-technologies/cakephp/git/commits{/sha}","comments_url":"https://api.github.com/repos/cvo-technologies/cakephp/comments{/number}","issue_comment_url":"https://api.github.com/repos/cvo-technologies/cakephp/issues/comments{/number}","contents_url":"https://api.github.com/repos/cvo-technologies/cakephp/contents/{+path}","compare_url":"https://api.github.com/repos/cvo-technologies/cakephp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cvo-technologies/cakephp/merges","archive_url":"https://api.github.com/repos/cvo-technologies/cakephp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cvo-technologies/cakephp/downloads","issues_url":"https://api.github.com/repos/cvo-technologies/cakephp/issues{/number}","pulls_url":"https://api.github.com/repos/cvo-technologies/cakephp/pulls{/number}","milestones_url":"https://api.github.com/repos/cvo-technologies/cakephp/milestones{/number}","notifications_url":"https://api.github.com/repos/cvo-technologies/cakephp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cvo-technologies/cakephp/labels{/name}","releases_url":"https://api.github.com/repos/cvo-technologies/cakephp/releases{/id}","created_at":"2014-05-12T12:11:20Z","updated_at":"2014-07-26T19:41:00Z","pushed_at":"2015-10-21T08:33:17Z","git_url":"git://github.com/cvo-technologies/cakephp.git","ssh_url":"git@github.com:cvo-technologies/cakephp.git","clone_url":"https://github.com/cvo-technologies/cakephp.git","svn_url":"https://github.com/cvo-technologies/cakephp","homepage":"http://cakephp.org","size":86483,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"cakephp:master","ref":"master","sha":"2cba8e67f22318414b1c90c7ac0270367e6806e4","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":656494,"name":"cakephp","full_name":"cakephp/cakephp","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/cakephp","description":"CakePHP: The Rapid Development Framework for PHP - Official Repository","fork":false,"url":"https://api.github.com/repos/cakephp/cakephp","forks_url":"https://api.github.com/repos/cakephp/cakephp/forks","keys_url":"https://api.github.com/repos/cakephp/cakephp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cakephp/cakephp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cakephp/cakephp/teams","hooks_url":"https://api.github.com/repos/cakephp/cakephp/hooks","issue_events_url":"https://api.github.com/repos/cakephp/cakephp/issues/events{/number}","events_url":"https://api.github.com/repos/cakephp/cakephp/events","assignees_url":"https://api.github.com/repos/cakephp/cakephp/assignees{/user}","branches_url":"https://api.github.com/repos/cakephp/cakephp/branches{/branch}","tags_url":"https://api.github.com/repos/cakephp/cakephp/tags","blobs_url":"https://api.github.com/repos/cakephp/cakephp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cakephp/cakephp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cakephp/cakephp/git/refs{/sha}","trees_url":"https://api.github.com/repos/cakephp/cakephp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cakephp/cakephp/statuses/{sha}","languages_url":"https://api.github.com/repos/cakephp/cakephp/languages","stargazers_url":"https://api.github.com/repos/cakephp/cakephp/stargazers","contributors_url":"https://api.github.com/repos/cakephp/cakephp/contributors","subscribers_url":"https://api.github.com/repos/cakephp/cakephp/subscribers","subscription_url":"https://api.github.com/repos/cakephp/cakephp/subscription","commits_url":"https://api.github.com/repos/cakephp/cakephp/commits{/sha}","git_commits_url":"https://api.github.com/repos/cakephp/cakephp/git/commits{/sha}","comments_url":"https://api.github.com/repos/cakephp/cakephp/comments{/number}","issue_comment_url":"https://api.github.com/repos/cakephp/cakephp/issues/comments{/number}","contents_url":"https://api.github.com/repos/cakephp/cakephp/contents/{+path}","compare_url":"https://api.github.com/repos/cakephp/cakephp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cakephp/cakephp/merges","archive_url":"https://api.github.com/repos/cakephp/cakephp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cakephp/cakephp/downloads","issues_url":"https://api.github.com/repos/cakephp/cakephp/issues{/number}","pulls_url":"https://api.github.com/repos/cakephp/cakephp/pulls{/number}","milestones_url":"https://api.github.com/repos/cakephp/cakephp/milestones{/number}","notifications_url":"https://api.github.com/repos/cakephp/cakephp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cakephp/cakephp/labels{/name}","releases_url":"https://api.github.com/repos/cakephp/cakephp/releases{/id}","created_at":"2010-05-08T14:38:22Z","updated_at":"2015-10-21T08:30:24Z","pushed_at":"2015-10-21T08:33:17Z","git_url":"git://github.com/cakephp/cakephp.git","ssh_url":"git@github.com:cakephp/cakephp.git","clone_url":"https://github.com/cakephp/cakephp.git","svn_url":"https://github.com/cakephp/cakephp","homepage":"http://cakephp.org","size":186497,"stargazers_count":6115,"watchers_count":6115,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":2794,"mirror_url":null,"open_issues_count":153,"forks":2794,"open_issues":153,"watchers":6115,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/cakephp/cakephp/pulls/7587"},"html":{"href":"https://github.com/cakephp/cakephp/pull/7587"},"issue":{"href":"https://api.github.com/repos/cakephp/cakephp/issues/7587"},"comments":{"href":"https://api.github.com/repos/cakephp/cakephp/issues/7587/comments"},"review_comments":{"href":"https://api.github.com/repos/cakephp/cakephp/pulls/7587/comments"},"review_comment":{"href":"https://api.github.com/repos/cakephp/cakephp/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/cakephp/cakephp/pulls/7587/commits"},"statuses":{"href":"https://api.github.com/repos/cakephp/cakephp/statuses/dff20b7a4ecb71ccb9f7b1a0e0b908517e940878"}}}}