Is there a way to use saveAll() with a datasource in Cakephp 2.0? I’ve been able to successfully use save(), but saveAll() triggers an error.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Yes you can use the saveAll with the datasource. You should have to pass the array like:
Then if you use $this->ModelName->saveAll($data), you will be able to save multiple records at once. And also if you pass an option ” ‘deep’ => true ” then you will be able to save multiple records in multiple related tables.