{"action":"opened","issue":{"url":"https://api.github.com/repos/ParsePlatform/parse-php-sdk/issues/140","labels_url":"https://api.github.com/repos/ParsePlatform/parse-php-sdk/issues/140/labels{/name}","comments_url":"https://api.github.com/repos/ParsePlatform/parse-php-sdk/issues/140/comments","events_url":"https://api.github.com/repos/ParsePlatform/parse-php-sdk/issues/140/events","html_url":"https://github.com/ParsePlatform/parse-php-sdk/issues/140","id":102726141,"number":140,"title":"Not sure how ::SaveAll() works","user":{"login":"piu-coder","id":5896822,"avatar_url":"https://avatars.githubusercontent.com/u/5896822?v=3","gravatar_id":"","url":"https://api.github.com/users/piu-coder","html_url":"https://github.com/piu-coder","followers_url":"https://api.github.com/users/piu-coder/followers","following_url":"https://api.github.com/users/piu-coder/following{/other_user}","gists_url":"https://api.github.com/users/piu-coder/gists{/gist_id}","starred_url":"https://api.github.com/users/piu-coder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/piu-coder/subscriptions","organizations_url":"https://api.github.com/users/piu-coder/orgs","repos_url":"https://api.github.com/users/piu-coder/repos","events_url":"https://api.github.com/users/piu-coder/events{/privacy}","received_events_url":"https://api.github.com/users/piu-coder/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-08-24T07:27:33Z","updated_at":"2015-08-24T07:27:33Z","closed_at":null,"body":"Hi All, \r\n\r\nI am trying to save multiple objects at once with ParseObject::saveAll(), but it is returning error invalid json or missing username password. Here is the code I am using:\r\n\r\n\tforeach($objectIds as $objectId ){\r\n\t\t\tif(isset($objectId['add'])){\r\n\t\t\t\tif(!in_array($objectId['add'],$checkDuplicate)){\r\n\t\t\t\t\t$parseUser = new ParseObject('_User', $objectId['add']);\r\n\t\t\t\t\t$parseUserFollower = new ParseObject('_User',ParseUser::getCurrentUser()->getObjectId() );\r\n\t\t\t\t\t$parseFollower = new ParseObject('UserFollower');\r\n\t\t\t\t\t$parseFollower->set('follower',$parseUserFollower);\r\n\t\t\t\t\t$parseFollower->set('followee',$parseUser);\r\n\t\t\t\t\t$parseFollower->set('isBlocked',false);\r\n\t\t\t\t\t//$parseFollower->set('ACL',json_encode(array('*' => array('read' => true), 'role:moderator' => array('write'=>true),$objectId['add'] => array('write' => true),\"role:admin\" => array('write' => true), Yii::app()->session['userProfile']->objectId => array('write' => true))));\r\n\t\t\t\t\t$checkDuplicate[] = $objectId['add'];\r\n\t\t\t\t\t$addObjects[] = $parseFollower;\r\n\t\t\t\t\t\r\n\t\t\t\t\t//$parseBatch->setBatchRequest(\"POST\",'UserFollower',Yii::app()->session['userProfile']->sessionToken, array('follower' => $parseBatch->dataType('pointer',array('_User',Yii::app()->session['userProfile']->objectId)), 'followee' => $parseBatch->dataType('pointer',array('_User',$objectId['add'])),'ACL' => array('*' => array('read' => true), 'role:moderator' => array('write'=>true),$objectId['add'] => array('write' => true),\"role:admin\" => array('write' => true), Yii::app()->session['userProfile']->objectId => array('write' => true)), 'isBlocked' => false));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif(isset($objectId['remove'])){\r\n\t\t\t\t$parseInvite = new ParseObject('UserInvitation',$objectId['remove']);\r\n\t\t\t\t$removeObjects[] = $parseInvite;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//$parseBatch->setBatchRequest(\"DELETE\",'UserInvitation/'.$objectId['remove'],Yii::app()->session['userProfile']->sessionToken);\r\n\t\t}\r\n\t\ttry{\r\n\t\t\t\r\n\t\t\tParseObject::saveAll($addObjects,true);\r\n\t\t\tParseObject::destroyBatch($removeObjects,true);\r\n\t\t\treturn true;\r\n\t\t\t\r\n\t\t}catch (ParseException $ex){\r\n\t\t\t\r\n\t\t\techo $ex->getMessage(); echo $ex->getCode();exit;\r\n\t\t}\t\r\n\r\nAlso not sure how destroyBatch is different from destroyAll. \r\nThanks in advance."}}