Esempio n. 1
0
 protected function populateMetaHeaderParams()
 {
     $params = array();
     if ($this->pageOffset != -11) {
         $params[PAE_Constants::PAGE_OFFSET] = "" . $this->pageOffset;
     }
     if ($this->pageMaxRecords != -1) {
         $params[PAE_Constants::PAGE_MAX_RECORDS] = "" . $this->pageMaxRecords;
     }
     $this->setACLHeader($params);
     if ($this->geoTag != null) {
         $params[PAE_Constants::GeoTag] = $this->geoTag->getJSONObject();
     }
     if (count($this->getSelectKeys()) > 0) {
         $selectJSONKeys = new JSONObject();
         foreach ($this->selectKeys as $key) {
             $selectJSONKeys->put($key, PAE_Constants::SELECT_KEY_FLAG);
         }
         $params[PAE_Constants::SELECT_KEYS_HEADER] = $selectJSONKeys;
     }
     $params['SDKName'] = "Php";
     if ($this->event != null && $this->event != "") {
         $params['event'] = $this->event;
     }
     if (App42API::getLoggedInUser() != null && App42API::getLoggedInUser() != "") {
         $params['loggedInUser'] = App42API::getLoggedInUser();
     }
     if ($this->query != null && $this->query != "") {
         $params['metaQuery'] = $this->query;
     }
     if ($this->jsonObject != null && $this->jsonObject != "") {
         $params['jsonObject'] = $this->jsonObject;
     }
     if ($this->dbName != null && $this->dbName != "" && $this->collectionName != null && $this->collectionName != "") {
         $obj = new JSONObject();
         $obj->put("dbName", $this->dbName);
         $obj->put("collectionName", $this->collectionName);
         $params['dbCredentials'] = $obj->__toString();
     }
     // Add Other meta headers if available
     if (count($this->getOtherMetaHeaders()) > 0) {
         $keySet = $this->getOtherMetaHeaders();
         foreach ($keySet as $key => $value) {
             if ($key != null && !$key == "" && $value != null && $value != "") {
                 $params[$key] = $value;
             }
         }
     }
     return $params;
 }