original_string: private function executeQuery($url, array $data = array(), array $extra_result_data = array())
      {
          $request = array(
              'outboundSMSMessageRequest' => array(
                  'address'                => array(sprintf('tel:%s', $data['to'])),
                  'senderAddress'          => sprintf('tel:%s', $data['from']),
                  'outboundSMSTextMessage' => array(
                      'message' => $data['text']
                  ),
              ),
          );
  
          $content = $this->getAdapter()->getContent($url, 'POST', $this->getHeaders(), json_encode($request));
  
          if (null == $content) {
              $results = $this->getDefaults();
          }
  
          if (is_string($content)) {
              $content = json_decode($content, true);
              $results['id'] = $content['outboundSMSMessageRequest']['clientCorrelator'];
  
              switch ($content['outboundSMSMessageRequest']['deliveryInfoList']['deliveryInfo'][0]['deliveryStatus']) {
                  case 'DeliveredToNetwork':
                      $results['status'] = ResultInterface::STATUS_SENT;
                      break;
                  case 'DeliveryImpossible':
                      $results['status'] = ResultInterface::STATUS_FAILED;
                      break;
              }
          }
  
          return array_merge($results, $extra_result_data);
      }
code: private function executeQuery($url, array $data = array(), array $extra_result_data = array())
      {
          $request = array(
              'outboundSMSMessageRequest' => array(
                  'address'                => array(sprintf('tel:%s', $data['to'])),
                  'senderAddress'          => sprintf('tel:%s', $data['from']),
                  'outboundSMSTextMessage' => array(
                      'message' => $data['text']
                  ),
              ),
          );
  
          $content = $this->getAdapter()->getContent($url, 'POST', $this->getHeaders(), json_encode($request));
  
          if (null == $content) {
              $results = $this->getDefaults();
          }
  
          if (is_string($content)) {
              $content = json_decode($content, true);
              $results['id'] = $content['outboundSMSMessageRequest']['clientCorrelator'];
  
              switch ($content['outboundSMSMessageRequest']['deliveryInfoList']['deliveryInfo'][0]['deliveryStatus']) {
                  case 'DeliveredToNetwork':
                      $results['status'] = ResultInterface::STATUS_SENT;
                      break;
                  case 'DeliveryImpossible':
                      $results['status'] = ResultInterface::STATUS_FAILED;
                      break;
              }
          }
  
          return array_merge($results, $extra_result_data);
      }
code_tokens: private function executeQuery ( $ url , array $ data = array ( ) , array $ extra_result_data = array ( ) ) { $ request = array ( 'outboundSMSMessageRequest' => array ( 'address' => array ( sprintf ( 'tel:%s' , $ data [ 'to' ] ) ) , 'senderAddress' => sprintf ( 'tel:%s' , $ data [ 'from' ] ) , 'outboundSMSTextMessage' => array ( 'message' => $ data [ 'text' ] ) , ) , ) ; $ content = $ this -> getAdapter ( ) -> getContent ( $ url , 'POST' , $ this -> getHeaders ( ) , json_encode ( $ request ) ) ; if ( null == $ content ) { $ results = $ this -> getDefaults ( ) ; } if ( is_string ( $ content ) ) { $ content = json_decode ( $ content , true ) ; $ results [ 'id' ] = $ content [ 'outboundSMSMessageRequest' ] [ 'clientCorrelator' ] ; switch ( $ content [ 'outboundSMSMessageRequest' ] [ 'deliveryInfoList' ] [ 'deliveryInfo' ] [ 0 ] [ 'deliveryStatus' ] ) { case 'DeliveredToNetwork' : $ results [ 'status' ] = ResultInterface :: STATUS_SENT ; break ; case 'DeliveryImpossible' : $ results [ 'status' ] = ResultInterface :: STATUS_FAILED ; break ; } } return array_merge ( $ results , $ extra_result_data ) ; }
docstring: do the query
docstring_tokens: do the query