{"action":"closed","issue":{"url":"https://api.github.com/repos/yiisoft/yii2/issues/7528","labels_url":"https://api.github.com/repos/yiisoft/yii2/issues/7528/labels{/name}","comments_url":"https://api.github.com/repos/yiisoft/yii2/issues/7528/comments","events_url":"https://api.github.com/repos/yiisoft/yii2/issues/7528/events","html_url":"https://github.com/yiisoft/yii2/issues/7528","id":59534538,"number":7528,"title":"Saving multiple models doesn't work properly","user":{"login":"XzAeRo","id":1656037,"avatar_url":"https://avatars.githubusercontent.com/u/1656037?v=3","gravatar_id":"","url":"https://api.github.com/users/XzAeRo","html_url":"https://github.com/XzAeRo","followers_url":"https://api.github.com/users/XzAeRo/followers","following_url":"https://api.github.com/users/XzAeRo/following{/other_user}","gists_url":"https://api.github.com/users/XzAeRo/gists{/gist_id}","starred_url":"https://api.github.com/users/XzAeRo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/XzAeRo/subscriptions","organizations_url":"https://api.github.com/users/XzAeRo/orgs","repos_url":"https://api.github.com/users/XzAeRo/repos","events_url":"https://api.github.com/users/XzAeRo/events{/privacy}","received_events_url":"https://api.github.com/users/XzAeRo/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-03-02T19:33:38Z","updated_at":"2015-03-04T02:17:41Z","closed_at":"2015-03-04T02:17:41Z","body":"I'm reading data from an uploaded Excel file via PHPExcel, and when I try to save the data (1 model per row), Yii only saves the first one in the database.\r\nThis is what I'm doing:\r\n\r\nIn UploadController.php, I have something like this:\r\n```php\r\npublic function actionProducts()\r\n{\r\n    // PHPExcel file load and sheet selection stuff\r\n    // ...\r\n\r\n    //  Get worksheet dimensions\r\n    $highestRow = $sheet->getHighestRow(); \r\n    $highestColumn = $sheet->getHighestColumn();\r\n\r\n    //  Loop through each row of the worksheet in turn (except the header)\r\n    for ($row = 2; $row <= $highestRow; $row++){ \r\n        // New model each iteration\r\n        $model = new \\common\\models\\Product;\r\n\r\n        //  Set the data to each attribute\r\n        $model->name = $objPHPExcel->getActiveSheet()->getCell('A'.$row)->getValue();\r\n        $model->price = $objPHPExcel->getActiveSheet()->getCell('B'.$row)->getValue();\r\n        // Etc...\r\n\r\n        $model->save();\r\n    }\r\n}\r\n```\r\n\r\nWhen that code is executed, only the first iteration of the for-loop is being saved in the database.\r\n\r\nNow, I've debugged showing what has been setted each iteration, and also verifying that each iteration is actually happening (and not breaking). Also, the logs don't show anything abnormal.\r\n\r\nAnyone with similar behaviours in v2.0.3?\r\n"}}