Zurmo does not allow multiple create

RuneMasta

New Member
When i try to create multiple records zurmo saved only one of them. I am calling resthelper.php for creating records.In this code it creates only one record. I think i should customize zurmo for multiple creation but i dont know the files that i must customizeThis is the code that calls restful api\[code\]$response = ApiRestHelper::createApiCall('http://localhost/zurmo/app/index.php/accounts/account/api/create/', 'POST', $headers, $accounts );\[/code\]This is resthelper.php.\[code\] <?php class ApiRestHelper {function createApiCall($url, $method, $headers, $data = http://stackoverflow.com/questions/12776944/array()){ if ($method =='PUT') { $headers[] = 'X-HTTP-Method-Override: PUT'; } $test = 'Step 1/2'; $handle = curl_init(); curl_setopt($handle, CURLOPT_URL, $url); curl_setopt($handle, CURLOPT_HTTPHEADER, $headers); curl_setopt($handle, CURLOPT_RETURNTRANSFER, true); curl_setopt($handle, CURLOPT_SSL_VERIFYHOST, false); curl_setopt($handle, CURLOPT_SSL_VERIFYPEER, false); switch($method) { case 'GET': break; case 'POST': foreach($data as $account){ curl_setopt($handle, CURLOPT_POST, true); curl_setopt($handle, CURLOPT_POSTFIELDS, http_build_query($account)); $test = 'Step 2'; } break; case 'PUT': foreach($data as $account){ curl_setopt($handle, CURLOPT_CUSTOMREQUEST, 'PUT'); curl_setopt($handle, CURLOPT_POSTFIELDS, http_build_query($account)); } break; case 'DELETE': curl_setopt($handle, CURLOPT_CUSTOMREQUEST, 'DELETE'); break; } $response = curl_exec($handle); return $response; } } ?>\[/code\]
 
Top