{"action":"closed","issue":{"url":"https://api.github.com/repos/cakephp/cakephp/issues/7613","labels_url":"https://api.github.com/repos/cakephp/cakephp/issues/7613/labels{/name}","comments_url":"https://api.github.com/repos/cakephp/cakephp/issues/7613/comments","events_url":"https://api.github.com/repos/cakephp/cakephp/issues/7613/events","html_url":"https://github.com/cakephp/cakephp/issues/7613","id":113569755,"number":7613,"title":"3.1, Cannot save an array of entities","user":{"login":"davidyell","id":49889,"avatar_url":"https://avatars.githubusercontent.com/u/49889?v=3","gravatar_id":"","url":"https://api.github.com/users/davidyell","html_url":"https://github.com/davidyell","followers_url":"https://api.github.com/users/davidyell/followers","following_url":"https://api.github.com/users/davidyell/following{/other_user}","gists_url":"https://api.github.com/users/davidyell/gists{/gist_id}","starred_url":"https://api.github.com/users/davidyell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidyell/subscriptions","organizations_url":"https://api.github.com/users/davidyell/orgs","repos_url":"https://api.github.com/users/davidyell/repos","events_url":"https://api.github.com/users/davidyell/events{/privacy}","received_events_url":"https://api.github.com/users/davidyell/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-10-27T12:17:25Z","updated_at":"2015-10-27T12:20:16Z","closed_at":"2015-10-27T12:20:16Z","body":"**What am I expecting?**\r\nTo be able to save an array of entities.\r\n\r\n```php\r\n$data = [\r\n    0 => [\r\n        'id' => 7,\r\n        'foo' => 'bar'\r\n    ],\r\n    1 => [\r\n        'id' => 9,\r\n        'foo' => 'bar'\r\n    ],\r\n];\r\n$stuff = $this->Examples->find()->where(['id IN' => [7,9]]);\r\n\r\n$patched = $this->Examples->patchEntity($stuff, $data);\r\n\r\n$this->Examples->save($patched);\r\n```\r\n\r\n**What happens?**\r\n`Argument 1 passed to Cake\\ORM\\Table::save() must implement interface Cake\\Datasource\\EntityInterface, array given`\r\n\r\n**Sidestep**\r\n```php\r\nforeach ($patched as $entity) {\r\n    $this->Examples->save($entity);\r\n    // Collate any saving errors across the array of entities and feedback to the user\r\n}\r\n```"}}