{"action":"created","comment":{"url":"https://api.github.com/repos/cakephp/cakephp/pulls/comments/43572100","id":43572100,"diff_hunk":"@@ -828,6 +828,69 @@ public function testReplaceLinkSuccess()\n         $this->assertFalse($entity->dirty('tags'));\n     }\n \n+\n+    /**\n+     * Tests that replaceLinks() will contain() the target table when\n+     * there are conditions present on the association.\n+     *\n+     * @return void\n+     */\n+    public function testReplaceLinkWithConditions()\n+    {\n+        $connection = ConnectionManager::get('test');\n+        $joint = $this->getMock(\n+            '\\Cake\\ORM\\Table',\n+            ['find'],\n+            [['alias' => 'ArticlesTags', 'connection' => $connection]]\n+        );\n+        $config = [\n+            'sourceTable' => $this->article,\n+            'targetTable' => $this->tag,\n+            'through' => $joint,\n+            'joinTable' => 'tags_articles',\n+            'conditions' => ['Tags.id' => 'blah'],\n+        ];\n+        $assoc = $this->getMock(\n+            '\\Cake\\ORM\\Association\\BelongsToMany',\n+            ['_collectJointEntities'],\n+            ['tags', $config]\n+        );\n+        $assoc->junction();\n+\n+        $query1 = $this->getMock(\n+            '\\Cake\\ORM\\Query',\n+            ['where', 'andWhere', 'addDefaultTypes', 'contain'],\n+            [$connection, $joint]\n+        );\n+        $query1->expects($this->at(0))\n+            ->method('where')\n+            ->will($this->returnSelf());\n+        $query1->expects($this->at(1))\n+            ->method('where')\n+            ->will($this->returnSelf());\n+        $query1->expects($this->at(2))\n+            ->method('contain')\n+            ->with('Tags')\n+            ->will($this->returnSelf());\n+        $query1->expects($this->at(3))\n+            ->method('andWhere')\n+            ->with($config['conditions'])\n+            ->will($this->returnSelf());\n+        $query1->setResult(new \\ArrayIterator([]));\n+\n+        $joint->expects($this->at(0))->method('find')\n+            ->with('all')\n+            ->will($this->returnValue($query1));\n+\n+        $entity = new Entity(['id' => 1, 'test' => []]);\n+\n+        $assoc->expects($this->once())->method('_collectJointEntities')\n+            ->with($entity, [])\n+            ->will($this->returnValue([]));\n+\n+        $assoc->replaceLinks($entity, [], ['associated' => false]);","path":"tests/TestCase/ORM/Association/BelongsToManyTest.php","position":64,"original_position":64,"commit_id":"16216c0f97e5fee2d6c7be03c09a7f00d1b1b173","original_commit_id":"16216c0f97e5fee2d6c7be03c09a7f00d1b1b173","user":{"login":"beporter","id":637270,"avatar_url":"https://avatars.githubusercontent.com/u/637270?v=3","gravatar_id":"","url":"https://api.github.com/users/beporter","html_url":"https://github.com/beporter","followers_url":"https://api.github.com/users/beporter/followers","following_url":"https://api.github.com/users/beporter/following{/other_user}","gists_url":"https://api.github.com/users/beporter/gists{/gist_id}","starred_url":"https://api.github.com/users/beporter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/beporter/subscriptions","organizations_url":"https://api.github.com/users/beporter/orgs","repos_url":"https://api.github.com/users/beporter/repos","events_url":"https://api.github.com/users/beporter/events{/privacy}","received_events_url":"https://api.github.com/users/beporter/received_events","type":"User","site_admin":false},"body":"Well it does, but with a kind of strange description: \"Mocked method does not exist.\"\r\n\r\n```\r\n$ vendor/bin/phpunit tests/TestCase/ORM/Association/BelongsToManyTest.php\r\n --filter testReplaceLinkWith\r\nPHPUnit 5.0.8 by Sebastian Bergmann and contributors.\r\n\r\nF                                                                   1 / 1 (100%)\r\n\r\nTime: 854 ms, Memory: 9.50Mb\r\n\r\nThere was 1 failure:\r\n\r\n1) Cake\\Test\\TestCase\\ORM\\Association\\BelongsToManyTest::testReplaceLinkWithConditions\r\nExpectation failed for method name is equal to <string:contain> when invoked at sequence \r\nindex 2.\r\nMocked method does not exist.\r\n\r\nFAILURES!\r\nTests: 1, Assertions: 3, Failures: 1.\r\n```\r\n\r\nAdmittedly, I'd be happier with a test that actually attempted to run the resulting SQL that included the target table's alias to ensure it was executable, but that's probably not appropriate or practical here.","created_at":"2015-10-31T14:11:55Z","updated_at":"2015-10-31T14:11:55Z","html_url":"https://github.com/cakephp/cakephp/pull/7626#discussion_r43572100","pull_request_url":"https://api.github.com/repos/cakephp/cakephp/pulls/7626","_links":{"self":{"href":"https://api.github.com/repos/cakephp/cakephp/pulls/comments/43572100"},"html":{"href":"https://github.com/cakephp/cakephp/pull/7626#discussion_r43572100"},"pull_request":{"href":"https://api.github.com/repos/cakephp/cakephp/pulls/7626"}}},"pull_request":{"url":"https://api.github.com/repos/cakephp/cakephp/pulls/7626","id":49276504,"html_url":"https://github.com/cakephp/cakephp/pull/7626","diff_url":"https://github.com/cakephp/cakephp/pull/7626.diff","patch_url":"https://github.com/cakephp/cakephp/pull/7626.patch","issue_url":"https://api.github.com/repos/cakephp/cakephp/issues/7626","number":7626,"state":"open","locked":false,"title":"Contain target table in BelongsToMany::replaceLinks() when conditions present.","user":{"login":"beporter","id":637270,"avatar_url":"https://avatars.githubusercontent.com/u/637270?v=3","gravatar_id":"","url":"https://api.github.com/users/beporter","html_url":"https://github.com/beporter","followers_url":"https://api.github.com/users/beporter/followers","following_url":"https://api.github.com/users/beporter/following{/other_user}","gists_url":"https://api.github.com/users/beporter/gists{/gist_id}","starred_url":"https://api.github.com/users/beporter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/beporter/subscriptions","organizations_url":"https://api.github.com/users/beporter/orgs","repos_url":"https://api.github.com/users/beporter/repos","events_url":"https://api.github.com/users/beporter/events{/privacy}","received_events_url":"https://api.github.com/users/beporter/received_events","type":"User","site_admin":false},"body":"**tl;dr: You can't use `[conditions]` that include fields from the target table in a belongsToMany association. This PR fixes that by `->contain()`ing the target table when `->conditions()` are present on the belongsToMany association.**\r\n\r\nI've written an example test case that demonstrates the current (incorrect) behavior here: [`PostsTableTest::testSaveNewPostWithTags()`](https://github.com/beporter/cake3-tests/blob/bf99468/tests/TestCase/Model/Table/PostsTableTest.php#L190,L220). This test case will produce a PDO error due to a field named in [conditions] missing from the SELECT to find existing records.\r\n\r\nRef: https://github.com/beporter/cake3-tests#applying-conditions-using-the-far-table-in-a-belongstomany-relationship\r\n\r\n---\r\n\r\nLet's say I have `Posts`, and `Tags`. Posts can be assigned many Tags, and Tags can be re-used on many Posts. This is a classic belongsToMany relationship, and is represented in the database using a \"glue\" table, conventionally named `posts_tags` and containing at minimum a `post_id` and a `tag_id`.\r\n\r\nBut what if our **Tags** have additional properties? Say for example that like StackOverflow, some of our Tags are \"sponsored\" and we need to present them in the finished app separately from \"unsponsored\" Tags.\r\n\r\nWell, we could add a boolean field to the Tags table call `is_sponsored` and use it to indicate which \"bucket\" a Tag belongs to.\r\n\r\n```sql\r\n# Dump of table tags\r\n# ------------------------------------------------------------\r\n\r\nCREATE TABLE `tags` (\r\n  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,\r\n  `name` varchar(255) NOT NULL DEFAULT '' COMMENT 'Display name of the Tag.',\r\n  `is_sponsored` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT 'Like StackOverflow, some tags can come from sponsors and need to be displayed and handled separately.',\r\n  PRIMARY KEY (`id`)\r\n) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Available Tags for assignment to Posts. Some tags are from sponsors.';\r\n```\r\n\r\nThen, for the sake of easy filtering and look up, we can define a few custom associations in the `PostsTable`:\r\n\r\n```php\r\n    public function initialize(array $config)\r\n    {\r\n        parent::initialize($config);\r\n\r\n        $this->table('posts');\r\n        $this->displayField('title');\r\n        $this->primaryKey('id');\r\n\r\n        $this->hasMany('Comments', [\r\n            'foreignKey' => 'post_id'\r\n        ]);\r\n\r\n        // This is the \"normal\" association, and will contain ALL\r\n        // associated Tags, regardless of the `is_sponsored` value.\r\n        $this->belongsToMany('Tags', [\r\n            'foreignKey' => 'post_id',\r\n            'targetForeignKey' => 'tag_id',\r\n            'joinTable' => 'posts_tags'\r\n        ]);\r\n\r\n        // Extra convenience associations. Groups any associated Tags\r\n        // into \"sponsored\" and \"unsponsored\" buckets.\r\n        $this->belongsToMany('SponsoredTags', [\r\n            'className' => 'Tags',\r\n            'foreignKey' => 'post_id',\r\n            'targetForeignKey' => 'tag_id',\r\n            'joinTable' => 'posts_tags',\r\n            'conditions' => [\r\n                'SponsoredTags.is_sponsored' => true,\r\n            ],\r\n        ]);\r\n        $this->belongsToMany('UnsponsoredTags', [\r\n            'className' => 'Tags',\r\n            'foreignKey' => 'post_id',\r\n            'targetForeignKey' => 'tag_id',\r\n            'joinTable' => 'posts_tags',\r\n            'conditions' => [\r\n                'SponsoredTags.is_sponsored' => false,\r\n            ],\r\n        ]);\r\n    }\r\n```\r\n\r\nThese relationships give us nice lists of Tags that are already pre-sorted by whether they are sponsored or not.\r\n\r\nWe must remember to also make these accessible in our Entity:\r\n\r\n```php\r\nclass Post extends Entity\r\n{\r\n    /**\r\n     * Fields that can be mass assigned using newEntity() or patchEntity().\r\n     *\r\n     * @var array\r\n     */\r\n    protected $_accessible = [\r\n        'title' => true,\r\n        'body' => true,\r\n        'comments' => true,\r\n        'tags' => true,\r\n        'sponsored_tags' => true,  // NEW!\r\n        'unsponsored_tags' => true,  // NEW!\r\n    ];\r\n}\r\n```\r\n\r\nSo here's where the issue comes in: When you try to **save** these relationships, you're going to run problems.\r\n\r\nTake this example request data array:\r\n\r\n```php\r\n$data = [\r\n    'title' => 'Post with sponsored and unsponsored tags',\r\n    'body' => '\r\n        This demonstrates request data where default (baked) multi-select\r\n        inputs have been used for `sponsored_tags._ids` and\r\n        `unsponsored_tags._ids`.\r\n    ',\r\n    'sponsored_tags' => [\r\n        '_ids' => [\r\n            4, // Loadsys\r\n        ],\r\n    ],\r\n    'unsponsored_tags' => [\r\n        '_ids' => [\r\n            2, // bugs\r\n            3, // orm\r\n        ],\r\n    ],\r\n];\r\n```\r\n\r\nIn our controller, we would of course have to remember to tell the ORM that we want it to retain this related data:\r\n\r\n```php\r\n$entityOptions = [\r\n    'associated' => ['SponsoredTags', 'UnsponsoredTags'],\r\n];\r\n$entity = $this->Posts->newEntity($data, $entityOptions);\r\n```\r\n\r\nAnd then we save it:\r\n\r\n```php\r\n$result = $this->Posts->save($entity);\r\n```\r\n\r\n**...which produces the following error:**\r\n\r\n```shell\r\nPDOException: SQLSTATE[42S22]: Column not found:\r\n  1054 Unknown column 'SponsoredTags.is_sponsored' in 'where clause'\r\n\r\nROOT/vendor/cakephp/cakephp/src/Database/Statement/MysqlStatement.php:36\r\nROOT/vendor/cakephp/cakephp/src/Database/Connection.php:270\r\nROOT/vendor/cakephp/cakephp/src/Database/Query.php:174\r\nROOT/vendor/cakephp/cakephp/src/ORM/Query.php:872\r\nROOT/vendor/cakephp/cakephp/src/Datasource/QueryTrait.php:272\r\nROOT/vendor/cakephp/cakephp/src/ORM/Query.php:823\r\nROOT/vendor/cakephp/cakephp/src/Datasource/QueryTrait.php:131\r\nROOT/vendor/cakephp/cakephp/src/ORM/Association/BelongsToMany.php:816\r\nROOT/vendor/cakephp/cakephp/src/ORM/Association/BelongsToMany.php:765\r\nROOT/vendor/cakephp/cakephp/src/Database/Connection.php:557\r\nROOT/vendor/cakephp/cakephp/src/ORM/Association/BelongsToMany.php:786\r\nROOT/vendor/cakephp/cakephp/src/ORM/Association/BelongsToMany.php:463\r\nROOT/vendor/cakephp/cakephp/src/ORM/AssociationCollection.php:251\r\nROOT/vendor/cakephp/cakephp/src/ORM/AssociationCollection.php:227\r\nROOT/vendor/cakephp/cakephp/src/ORM/AssociationCollection.php:192\r\nROOT/vendor/cakephp/cakephp/src/ORM/Table.php:1457\r\nROOT/vendor/cakephp/cakephp/src/ORM/Table.php:1377\r\nROOT/vendor/cakephp/cakephp/src/Database/Connection.php:557\r\nROOT/vendor/cakephp/cakephp/src/ORM/Table.php:1378\r\nROOT/tests/TestCase/Model/Table/PostsTableTest.php:214\r\n```\r\n\r\nThe SQL query being executed looks like this:\r\n\r\n```sql\r\nSELECT\r\n    PostsTags.post_id AS `PostsTags__post_id`,\r\n    PostsTags.tag_id AS `PostsTags__tag_id`\r\nFROM\r\n    posts_tags PostsTags\r\nWHERE\r\n    (post_id = :c0 AND SponsoredTags.is_sponsored = :c1)\r\n```\r\n\r\n...which obviously is wrong and bad because there's no `JOIN` on `tags AS SponsoredTags` in there that would make the `is_sponsored` field available for use in the `WHERE` clause.\r\n\r\n\r\n---\r\n\r\n\r\nThe source of this error is in [`\\Cake\\ORM\\Assoiation\\BelongsToMany::replaceLinks()`](https://github.com/cakephp/cakephp/blob/084ef76/src/ORM/Association/BelongsToMany.php#L761):\r\n\r\n```php\r\n    public function replaceLinks(EntityInterface $sourceEntity, array $targetEntities, array $options = [])\r\n    {\r\n        $bindingKey = (array)$this->bindingKey();\r\n        $primaryValue = $sourceEntity->extract($bindingKey);\r\n        if (count(array_filter($primaryValue, 'strlen')) !== count($bindingKey)) {\r\n            $message = 'Could not find primary key value for source entity';\r\n            throw new InvalidArgumentException($message);\r\n        }\r\n        return $this->junction()->connection()->transactional(\r\n            function () use ($sourceEntity, $targetEntities, $primaryValue, $options) {\r\n                $foreignKey = (array)$this->foreignKey();\r\n                $hasMany = $this->source()->association($this->_junctionTable->alias());\r\n                $existing = $hasMany->find('all')\r\n                    ->where(array_combine($foreignKey, $primaryValue));\r\n                $associationConditions = $this->conditions();\r\n                if ($associationConditions) {\r\n// !! RIGHT HERE !!\r\n                    $existing->andWhere($associationConditions);\r\n                }\r\n                $jointEntities = $this->_collectJointEntities($sourceEntity, $targetEntities);\r\n                $inserts = $this->_diffLinks($existing, $jointEntities, $targetEntities);\r\n                if ($inserts && !$this->_saveTarget($sourceEntity, $inserts, $options)) {\r\n                    return false;\r\n                }\r\n                $property = $this->property();\r\n                if (count($inserts)) {\r\n                    $inserted = array_combine(\r\n                        array_keys($inserts),\r\n                        (array)$sourceEntity->get($property)\r\n                    );\r\n                    $targetEntities = $inserted + $targetEntities;\r\n                }\r\n                ksort($targetEntities);\r\n                $sourceEntity->set($property, array_values($targetEntities));\r\n                $sourceEntity->dirty($property, false);\r\n                return true;\r\n            }\r\n        );\r\n    }\r\n```\r\n\r\nThis method is intended to delete, add or update any records in the join table in order to make them \"match\" with the set of IDs provided in our `Table::save()` call. Preserving the conditions through this process in this case **is necessary**. Without them, we'd wipe out any existing `unsponsored` link records when we saved the updated list of `sponsored` records, and vice versa. We need to make sure we **only** operate on those `PostsTags` records where the `post_id` matches our new record from the `Table::save()` like always, but _also_ where the associated `Tag.is_sponsored` is either specifically `true` or `false`.\r\n\r\nThe solution seems to be that `::replaceLinks()` needs to `->contain()` the target table when conditions are present so all possible fields that are relevant to the association are available for use. (However, doing this for _every_ association may be ill-advised for a number of reasons, hence restricting it to only those times when conditions are present that might involve the target table.)","created_at":"2015-10-30T14:36:14Z","updated_at":"2015-10-31T14:11:55Z","closed_at":null,"merged_at":null,"merge_commit_sha":"74c0b1288ebac9e61d1de208237fb48bc3eaf04c","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":21,"closed_issues":35,"state":"open","created_at":"2015-10-19T01:08:03Z","updated_at":"2015-10-31T01:26:13Z","due_on":"2015-11-01T04:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/cakephp/cakephp/pulls/7626/commits","review_comments_url":"https://api.github.com/repos/cakephp/cakephp/pulls/7626/comments","review_comment_url":"https://api.github.com/repos/cakephp/cakephp/pulls/comments{/number}","comments_url":"https://api.github.com/repos/cakephp/cakephp/issues/7626/comments","statuses_url":"https://api.github.com/repos/cakephp/cakephp/statuses/16216c0f97e5fee2d6c7be03c09a7f00d1b1b173","head":{"label":"beporter:belongstomany-conditions-on-target","ref":"belongstomany-conditions-on-target","sha":"16216c0f97e5fee2d6c7be03c09a7f00d1b1b173","user":{"login":"beporter","id":637270,"avatar_url":"https://avatars.githubusercontent.com/u/637270?v=3","gravatar_id":"","url":"https://api.github.com/users/beporter","html_url":"https://github.com/beporter","followers_url":"https://api.github.com/users/beporter/followers","following_url":"https://api.github.com/users/beporter/following{/other_user}","gists_url":"https://api.github.com/users/beporter/gists{/gist_id}","starred_url":"https://api.github.com/users/beporter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/beporter/subscriptions","organizations_url":"https://api.github.com/users/beporter/orgs","repos_url":"https://api.github.com/users/beporter/repos","events_url":"https://api.github.com/users/beporter/events{/privacy}","received_events_url":"https://api.github.com/users/beporter/received_events","type":"User","site_admin":false},"repo":{"id":45208415,"name":"cakephp","full_name":"beporter/cakephp","owner":{"login":"beporter","id":637270,"avatar_url":"https://avatars.githubusercontent.com/u/637270?v=3","gravatar_id":"","url":"https://api.github.com/users/beporter","html_url":"https://github.com/beporter","followers_url":"https://api.github.com/users/beporter/followers","following_url":"https://api.github.com/users/beporter/following{/other_user}","gists_url":"https://api.github.com/users/beporter/gists{/gist_id}","starred_url":"https://api.github.com/users/beporter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/beporter/subscriptions","organizations_url":"https://api.github.com/users/beporter/orgs","repos_url":"https://api.github.com/users/beporter/repos","events_url":"https://api.github.com/users/beporter/events{/privacy}","received_events_url":"https://api.github.com/users/beporter/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/beporter/cakephp","description":"CakePHP: The Rapid Development Framework for PHP - Official Repository","fork":true,"url":"https://api.github.com/repos/beporter/cakephp","forks_url":"https://api.github.com/repos/beporter/cakephp/forks","keys_url":"https://api.github.com/repos/beporter/cakephp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/beporter/cakephp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/beporter/cakephp/teams","hooks_url":"https://api.github.com/repos/beporter/cakephp/hooks","issue_events_url":"https://api.github.com/repos/beporter/cakephp/issues/events{/number}","events_url":"https://api.github.com/repos/beporter/cakephp/events","assignees_url":"https://api.github.com/repos/beporter/cakephp/assignees{/user}","branches_url":"https://api.github.com/repos/beporter/cakephp/branches{/branch}","tags_url":"https://api.github.com/repos/beporter/cakephp/tags","blobs_url":"https://api.github.com/repos/beporter/cakephp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/beporter/cakephp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/beporter/cakephp/git/refs{/sha}","trees_url":"https://api.github.com/repos/beporter/cakephp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/beporter/cakephp/statuses/{sha}","languages_url":"https://api.github.com/repos/beporter/cakephp/languages","stargazers_url":"https://api.github.com/repos/beporter/cakephp/stargazers","contributors_url":"https://api.github.com/repos/beporter/cakephp/contributors","subscribers_url":"https://api.github.com/repos/beporter/cakephp/subscribers","subscription_url":"https://api.github.com/repos/beporter/cakephp/subscription","commits_url":"https://api.github.com/repos/beporter/cakephp/commits{/sha}","git_commits_url":"https://api.github.com/repos/beporter/cakephp/git/commits{/sha}","comments_url":"https://api.github.com/repos/beporter/cakephp/comments{/number}","issue_comment_url":"https://api.github.com/repos/beporter/cakephp/issues/comments{/number}","contents_url":"https://api.github.com/repos/beporter/cakephp/contents/{+path}","compare_url":"https://api.github.com/repos/beporter/cakephp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/beporter/cakephp/merges","archive_url":"https://api.github.com/repos/beporter/cakephp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/beporter/cakephp/downloads","issues_url":"https://api.github.com/repos/beporter/cakephp/issues{/number}","pulls_url":"https://api.github.com/repos/beporter/cakephp/pulls{/number}","milestones_url":"https://api.github.com/repos/beporter/cakephp/milestones{/number}","notifications_url":"https://api.github.com/repos/beporter/cakephp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/beporter/cakephp/labels{/name}","releases_url":"https://api.github.com/repos/beporter/cakephp/releases{/id}","created_at":"2015-10-29T20:22:20Z","updated_at":"2015-10-29T20:22:36Z","pushed_at":"2015-10-31T02:22:44Z","git_url":"git://github.com/beporter/cakephp.git","ssh_url":"git@github.com:beporter/cakephp.git","clone_url":"https://github.com/beporter/cakephp.git","svn_url":"https://github.com/beporter/cakephp","homepage":"http://cakephp.org","size":88055,"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":"e32c5b26c923cb18677c92a2c41c066c965e87eb","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-31T14:08:38Z","pushed_at":"2015-10-31T02:22:45Z","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":186608,"stargazers_count":6130,"watchers_count":6130,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":2806,"mirror_url":null,"open_issues_count":152,"forks":2806,"open_issues":152,"watchers":6130,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/cakephp/cakephp/pulls/7626"},"html":{"href":"https://github.com/cakephp/cakephp/pull/7626"},"issue":{"href":"https://api.github.com/repos/cakephp/cakephp/issues/7626"},"comments":{"href":"https://api.github.com/repos/cakephp/cakephp/issues/7626/comments"},"review_comments":{"href":"https://api.github.com/repos/cakephp/cakephp/pulls/7626/comments"},"review_comment":{"href":"https://api.github.com/repos/cakephp/cakephp/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/cakephp/cakephp/pulls/7626/commits"},"statuses":{"href":"https://api.github.com/repos/cakephp/cakephp/statuses/16216c0f97e5fee2d6c7be03c09a7f00d1b1b173"}}}}