public function getJSONObject() { $obj = new JSONObject(); $obj->put("lat", $this->lat); $obj->put("lng", $this->lng); return $obj; }
public function getJSONObject() { $obj = new JSONObject(); $obj->put("latitude", $this->latitude); $obj->put("longitude", $this->longitude); $obj->put("markerName", $this->marker); return $obj; }
function deleteDocumentsByKeyValue($dbName, $collectionName, $key, $value) { Util::throwExceptionIfNullOrBlank($dbName, "DataBase Name"); Util::throwExceptionIfNullOrBlank($collectionName, "Collection Name"); Util::throwExceptionIfNullOrBlank($key, "Key"); Util::throwExceptionIfNullOrBlank($value, "Value"); $encodedDbName = Util::encodeParams($dbName); $encodedCollectionName = Util::encodeParams($collectionName); $encodedKey = Util::encodeParams($key); $responseObj = new App42Response(); $objUtil = new Util($this->apiKey, $this->secretKey); try { $params = null; $headerParams = array(); $queryParams = array(); $signParams = $this->populateSignParams(); $metaHeaders = $this->populateMetaHeaderParams(); $headerParams = array_merge($signParams, $metaHeaders); $json = new JSONObject(); $json->put("key", $value); $signParams['value'] = $json; $params = array_merge($queryParams, $signParams); $signParams['dbName'] = $dbName; $signParams['collectionName'] = $collectionName; $signParams['key'] = $key; $signature = urlencode($objUtil->sign($signParams)); //die(); $headerParams['signature'] = $signature; $contentType = $this->content_type; $accept = $this->accept; $baseURL = $this->url; $baseURL = $baseURL . "/deletebykey" . "/dbName" . "/" . $encodedDbName . "/collectionName" . "/" . $encodedCollectionName . "/" . $encodedKey; $response = RestClient::delete($baseURL, $params, null, null, $contentType, $accept, $headerParams); $responseObj->setStrResponse($response->getResponse()); $responseObj->setResponseSuccess(true); } catch (App42Exception $e) { throw $e; } catch (Exception $e) { throw new App42Exception($e); } return $responseObj; }
private function getJsonObj() { $aclArray = array(); $acl = new ACL($user, $permission); foreach ($this->{$acl} as $aclList) { $newJSON = new JSONObject(); $user = $acl->getUser(); $permission = $acl->getPermission(); $newJSON->put($user, $permission); array_push($aclArray, $newJSON); } return $aclArray; }