Esempio n. 1
0
 /**
  * {@inheritDoc}
  */
 public function getNearestZone(GetNearestZoneRequest $getNearestZoneRequest)
 {
     // If the 'application' attribute is not set in the request we try to get a default one from the Pushwoosh
     // client
     if ($getNearestZoneRequest->getApplication() === null) {
         // The 'application' must be set
         if (!isset($this->application)) {
             throw new PushwooshException('The  \'application\' property is not set !');
         }
         $getNearestZoneRequest->setApplication($this->application);
     }
     $response = $this->cURLClient->pushwooshCall('getNearestZone', $getNearestZoneRequest->jsonSerialize());
     return GetNearestZoneResponse::create($response);
 }
Esempio n. 2
0
 /**
  * {@inheritDoc}
  */
 public function getNearestZone(GetNearestZoneRequest $getNearestZoneRequest)
 {
     $this->pushwhooshRequests[] = $getNearestZoneRequest;
     return GetNearestZoneResponse::create(json_decode('{
            "status_code":200,
            "status_message":"OK"
            "response": {  
               "name":"zone name",
               "lat":42,
               "lng":42,
               "range":100,         
               "distance":4715784 
            }
         }', true));
 }
Esempio n. 3
0
 /**
  * {@inheritDoc}
  */
 public function getNearestZone(GetNearestZoneRequest $getNearestZoneRequest)
 {
     // If the 'application' attribute is not set in the request we try to get a default one from the Pushwoosh
     // client
     $this->setApplicationIfNotSet($getNearestZoneRequest);
     $response = $this->cURLClient->pushwooshCall('getNearestZone', $getNearestZoneRequest->jsonSerialize());
     return GetNearestZoneResponse::create($response);
 }