execute

@return JsonResponse
321251
public function execute()
    {
        $request       = $this->_request;
        $iTotalRecords = $this->_queryBuilder->getTotalRecords();
        list($data, $objects) = $this->_queryBuilder->getData();
        $id_index      = array_search('_identifier_', array_keys($this->getFields()));
        $ids           = array();
        array_walk($data, function($val, $key) use ($id_index, &$ids) {
            $ids[$key] = $val[$id_index];
        });
        if (!is_null($this->_fixed_data))
        {
            $this->_fixed_data = array_reverse($this->_fixed_data);
            foreach ($this->_fixed_data as $item)
            {
                array_unshift($data, $item);
            }
        }
        if (!is_null($this->_renderer))
        {
            array_walk($data, $this->_renderer);
        }
        if (!is_null($this->_renderer_obj))
        {
            $this->_renderer_obj->applyTo($data, $objects);
        }
        if (!empty($this->_multiple))
        {
            array_walk($data, function($val, $key) use(&$data, $ids) {
                array_unshift($val, "<input type='checkbox' name='dataTables[actions][]' value='{$ids[$key]}' />");
                $data[$key] = $val;
            });
        }
        $output = array(
            "sEcho"                => intval($request->get('sEcho')),
            "iTotalRecords"        => $iTotalRecords,
            "iTotalDisplayRecords" => $iTotalRecords,
            "aaData"               => $data
        );
        return new JsonResponse($output);
    }
1311668
public function execute()
    {
        $this->_setOptions();

        $sResponse = $this->_execute();
        $this->_saveStatusCode();

        $iCurlErrorNumber = $this->_getErrorNumber();

        $this->_close();

        if ($iCurlErrorNumber) {
            $host = $this->getUrl();
            $parameters = http_build_query($this->getParameters(), "", "&");
            $message = $this->_getErrorMessage($iCurlErrorNumber);
            throw new Exception("cURL failed with message '$message' when calling '$host?$parameters'");
        }

        return $sResponse;
    }
1195983
public function execute()
    {
        $result = ['errors' => false, 'message' => ''];
        $website = $this->getRequest()->getParam('website', 0);
        $client = false;
        if ($this->data->isEnabled()) {
            $client = $this->data->getWebsiteApiClient($website);
        }
        $params = [
            'section' => 'connector_developer_settings',
            'website' => $website
        ];
        $redirectUrl = $this->getUrl('adminhtml/system_config/edit', $params);

        if (!$client) {
            $this->messageManager->addNoticeMessage('Please enable api first.');
        } else {
            // get all possible datatifileds
            $datafields = $this->datafield->getContactDatafields();
            $eeFields = $this->datafield->getExtraDataFields();
            foreach ($datafields as $key => $datafield) {
                $response = $client->postDataFields($datafield);

                //ignore existing datafields message
                if (isset($response->message) && $response->message !=
                    \Dotdigitalgroup\Email\Model\Apiconnector\Client::API_ERROR_DATAFIELD_EXISTS
                ) {
                    $result['errors'] = true;
                    $result['message'] .= ' Datafield ' . $datafield['name'] . ' - ' . $response->message . '</br>';
                } else {
                    if ($website) {
                        $scope = 'websites';
                        $scopeId = $website;
                    } else {
                        $scope = 'default';
                        $scopeId = '0';
                    }

                    //Config path depends on EE or CE
                    $configPath = isset($eeFields[$key]) ? 'connector_data_mapping/extra_data/' :
                        'connector_data_mapping/customer_data/';

                    //map the successfully created datafield
                    $this->data->saveConfigData(
                        $configPath . $key,
                        strtoupper($datafield['name']),
                        $scope,
                        $scopeId
                    );
                    $this->data->log('successfully connected : ' . $datafield['name']);
                }
            }
            if ($result['errors']) {
                $this->messageManager->addNoticeMessage($result['message']);
            } else {
                $this->messageManager->addSuccessMessage('All Data Fields Created And Mapped.');
            }

            //Clear config cache
            $this->config->reinit();
        }

        $this->_redirect($redirectUrl);
    }
488575
public function getJsonResponse()
    {
        $json = json_decode($this->httpResponse);
        if (is_null($json) && json_last_error() != JSON_ERROR_NONE) {
            return null; // decode error
        } else {
            return is_object($json) ? $json : null;
        }
    }
590758
public function execute()
    {
        $response = [];
        $valueName = $this->getRequest()->getParam('value');
        $conditionValue = $this->getRequest()->getParam('condValue');
        $attributeValue = $this->getRequest()->getParam('attributeValue');

        if ($valueName && $attributeValue && $conditionValue) {
            if ($conditionValue == 'null') {
                $valueOptions = $this->ruleValue->getValueSelectOptions($attributeValue, true);
                $response['cvalue'] = $this->getOptionHtml('cvalue', $valueName, $valueOptions);
            } else {
                $elmType = $this->ruleValue->getValueElementType($attributeValue);
                if ($elmType == 'select') {
                    $valueOptions = $this->ruleValue->getValueSelectOptions($attributeValue);
                    $response['cvalue'] = $this->getOptionHtml('cvalue', $valueName, $valueOptions);
                } elseif ($elmType == 'text') {
                    $html = "<input style='width:160px' title='cvalue' class='' id='' name=$valueName />";
                    $response['cvalue'] = $html;
                }
            }
            $this->http->getHeaders()->clearHeaders();
            $this->http->setHeader('Content-Type', 'application/json')->setBody(
                $this->jsonEncoder->jsonEncode($response)
            );
        }
    }
216706
public function execute()
    {
        $request = $this->initGraphqlRequest();
        $response = $request->postRaw(
            $this->buildPayload()
        );
        if ($response->getCode() !== 200) {
            throw ExceptionBuilder::fromHttpRequestAndResponse($request, $response);
        }

        return ResultSetBuilder::fromHttpResponse($response);
    }
101465
public function exec()
    {
        // Set the header
        $this->buildHttpHeader();

        $parameters = [
            'headers' => $this->headers,
            'body' => $this->postFields,
            'curl' => $this->setPostCurlopts(),
        ];

        // Get all of the results 1000 at a time
        return  $this->sendData('POST', $parameters);
    }
767640
public function execute() {
		$query = $this->buildQueryString();
		$result = $this->indexClient->executeStatement($query, $this->parameterMap);

		if (empty($result)) {
			return array();
		}

		return array_values($result);
	}
795594
public function listJsonAction()
    {
        $em = $this->getDoctrine()->getManager();

        /** @var \Kitchenit\AdminBundle\Services\DataTables\JsonList $jsonList */
        $jsonList = $this->get('json_list');
        $jsonList->setRepository($em->getRepository('EcommerceBundle:Invoice'));

        $response = $jsonList->get();

        return new JsonResponse($response);
    }
556083
public function execute()
    {
        $this->setOptions();

        $response = $this->parseResponse($this->curlExecute());

        $this->close();

        return $response;
    }
911094
public function run()
    {
        if ($this->layout !== null) {
            $this->controller->layout = $this->layout;
        }

        $this->app->getResponse()->setStatusCodeByException($this->getException());

        if ($this->app->getRequest()->getIsAjax()) {
            return $this->renderAjaxResponse();
        }

        return $this->renderHtmlResponse();
    }
8655
public function execute($actionContext) {
        // make json and exit
        if (($result = json_encode($this->data, $this->options, $this->depth)) === false) {
            throw new \ErrorException('JSON encode error #' . json_last_error() . ': ' . json_last_error_msg());
        }

        $response = $actionContext->getHttpContext()->getResponse();
        $response->addHeader('Content-Type', 'application/json');
        $response->write($result);
        $response->end();
    }
41855
public function execute()
    {
        set_error_handler([$this, 'processErrors'], E_WARNING);

        $stream = fopen($this->requestData['url'], 'r', false, $this->streamContext);

        $this->responseBody = stream_get_contents($stream);

        $this->responseHeaders = $http_response_header;

        $this->response = implode("\r\n", $http_response_header) . "\r\n\r\n" . $this->responseBody;

        restore_error_handler();
    }
751580
public function execute()
    {
        if (isset($_POST['ajax_submit']) || $_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest') {
            //if($this->app->jquery)$this->app->jquery->getJS($this->owner);

            if (headers_sent($file, $line)) {
                echo "<br/>Direct output (echo or print) detected on $file:$line. <a target='_blank' "
                    ."href='http://agiletoolkit.org/error/direct_output'>Use \$this->add('Text') instead</a>.<br/>";
            }

            $x = $this->app->template->get('document_ready');
            if (is_array($x)) {
                $x = implode('', $x);
            }
            echo $this->_render();
            $this->app->hook('post-js-execute');
            exit;
        } else {
            throw $this
                ->exception('js()->..->execute() must be used in response to form submission or AJAX operation only');
        }
    }
17081
protected function executeRequest()
    {
        if (!is_callable('curl_init')) {
            throw new Exception\ServiceReaderException('cURL not found.');
        }

        $options  = 'licenseID='  . urlencode($this->apiKey);
        $options .= '&paramsXML=' . urlencode($this->request->generateXMLRequestString());
        $options .= '&content='   . urlencode($this->request->getTextData());

        $ch = curl_init();
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($ch, CURLOPT_URL, $this->getApiEndpoint());
        curl_setopt($ch, CURLOPT_HEADER, 0);
        curl_setopt($ch, CURLOPT_POSTFIELDS, $options);
        curl_setopt($ch, CURLOPT_POST, 1);
        $response = curl_exec($ch);
        curl_close($ch);

        if (strpos($response, "<Exception>") !== false) {
            preg_match("/<Exception\>(.*)<\/Exception>/mu", $response, $matches);
            throw new Exception\ServiceReaderException($matches[1]);
        }

        return new OpenCalaisResponse($response, $this->request);
    }
776015
public function render()
    {
        $this->controllerContext->getResponse()->setHeader('Content-Type', 'application/json');
        $propertiesToRender = $this->renderArray();
        $options = $this->getOption('jsonEncodingOptions');
        return json_encode($propertiesToRender, $options);
    }
933114
public function execute(){
		$options = $this->form_endpoint->get_options();
		$action = @$this->query_options['action'];
		$data = $options['post_params'];

		$errors = $this->exdb->validate($this->table_name, $data);

		if( $action == 'write' ){
			if( count($errors) ){
				// validation でエラーが検出されたら、入力画面に戻る。
				return $this->input($data, $errors);
			}
			return $this->write($data);
		}elseif( $action == 'done' ){
			return $this->done();
		}elseif( $action == 'confirm' ){
			if( count($errors) ){
				// validation でエラーが検出されたら、入力画面に戻る。
				return $this->input($data, $errors);
			}
			return $this->confirm($data);
		}
		return $this->input($data);
	}