Execute a request and return the result as an array

@param unknown $request
@return multitype:multitype:
358670
public function processRequest($request,$rowIndex ='row'){
		$requestResult = array();
		$result = $this->execute($request);
		$i=0;
		while($row = mysql_fetch_assoc($result)){
			$index = $rowIndex.$i++;
			$requestResult[$index] = $row;
		}
		return $requestResult;
	}
1201574
public function execute($request)
    {
        RequestNotSupportedException::assertSupports($this, $request);

        $details = ArrayObject::ensureArrayObject($request->getModel());

        if (isset($details['RtnCode']) === false) {
            $request->markNew();

            return;
        }

        if ($details['RtnCode'] === '2') {
            $request->markPending();

            return;
        }

        if ($details['RtnCode'] === '1') {
            if (isset($details['Action']) === true) {
                switch ($details['Action']) {
                    case 'C':
                        $request->markCaptured();
                        break;
                    case 'R':
                        $request->markRefunded();
                        break;
                    case 'E':
                    case 'N':
                        $request->markCanceled();
                        break;
                }

                return;
            } else {
                $request->markCaptured();

                return;
            }
        }

        $request->markFailed();
    }
614616
public function execute($request)
    {
        RequestNotSupportedException::assertSupports($this, $request);

        $model = ArrayObject::ensureArrayObject($request->getModel());

        if (null === $model['error_code']) {
            $request->markNew();
            return;
        }

        if (self::SUCCESS === $model['error_code']) {
            $request->markCaptured();
            return;
        }

        $request->markFailed();

    }
918145
public function execute(Request $request): Response
    {
        $method = $request->getMethod();
        list($resp, $grpcStatus) = $request->getClient()->$method(
            $request->getMessage(),
            $request->getMetadata(),
            $request->getOptions()
        )->wait();

        $headers = new HeaderCollection();

        if (is_null($grpcStatus)) { // in the very bad case even this fails to return
            $status = new Error\Status(\Grpc\STATUS_UNKNOWN, '', $headers);
        } else {
            $metadata = $grpcStatus->metadata;
            foreach ($metadata as $k => $v) {
                if (is_array($v)) {
                    foreach ($v as $v2) {
                        $headers->add($k, $v2);
                    }
                } else {
                    $headers->add($k, $v);
                }
            }
            $status = new Error\Status(intval($grpcStatus->code), strval($grpcStatus->details), $headers);
        }

        if (is_null($resp)) {
            $request->fail($status);
        }

        return $request->succeed($resp, $status);
    }
490788
public function toArray($request)
    {
        return [
            'id'              => (int) $this->id,
            'author_id'       => $this->author_id,
            'language_code'   => $this->language_code,
            'title'           => $this->title,
            'teaser'          => $this->teaser,
            'body'            => $this->body,
            'seo_title'       => $this->seo_title,
            'seo_description' => $this->seo_description,
            'is_active'       => $this->is_active,
            'created_at'      => dateTimeToRequestTimezone($this->created_at)->toIso8601String(),
            'updated_at'      => dateTimeToRequestTimezone($this->updated_at)->toIso8601String(),
        ];
    }
800963
private function executeRequest(string $request): Response
    {
        $response = $this->transport->executeRequest($this->config['endpoint_uri'], $request);

        return new Response($response);
    }
764744
protected function executeRequest(Request $request)
    {
        $index = array_search($request, $this->waitingRequests);
        if ($index !== false) {
            unset($this->waitingRequests[$index]);
            $this->hydrateCurlFromRequest($request, $request->getCurl())
                 ->triggerCallback($request->getOnInitializeCallback(), $request);

            $this->multiCurl->addCurl($request->getCurl());
            $this->runningRequests[] = $request;
            $this->executeMultiCurl();
        }
        return $this;
    }
958297
public function handle($request)
    {
        $entity = $this->repository()->findById($request->getId());

        $this->authorize($request, $entity);

        $items = $this->getProperty($entity, $this->field());

        $replace = new ArrayCollection(array_map(
            function($raw) use ($entity) {
                return $this->getRelatedEntity($raw);
            },
            $request->getData()
        ));

        foreach ($items as $key => $item) {
            if (!$replace->contains($item)) {
                $items->remove($key);
            }
        }

        foreach ($replace as $item) {
            if (!$items->contains($item)) {
                $items->add($item);
            }
        }

        $this->setProperty($entity, $this->field(), $items);

        $this->repository()->getEntityManager()->flush($entity);

        return (
            new RelatedCollectionAction(
                $this->repository(),
                $this->mappedBy(),
                $this->related(),
                $this->transformer()
            )
        )->dispatch($request);
    }
422427
protected function executeRequest($request)
    {
        // 请求微信服务器
        $result = $this->request->curlPost($request->getRequestUrl(), $request->params());

        $result = (array)simplexml_load_string($result, 'SimpleXMLElement', LIBXML_NOCDATA);

        return $result;
    }
1160822
public static function fromRingRequest(array $request)
    {
        $options = [];
        if (isset($request['version'])) {
            $options['protocol_version'] = $request['version'];
        }

        if (!isset($request['http_method'])) {
            throw new \InvalidArgumentException('No http_method');
        }

        return new Request(
            $request['http_method'],
            Core::url($request),
            isset($request['headers']) ? $request['headers'] : [],
            isset($request['body']) ? Stream::factory($request['body']) : null,
            $options
        );
    }
1209172
public function toArray($request)
    {
        /** @var \Unite\Transactions\Models\Transaction $this->resource */
        return [
            'id'                 => $this->id,
            'type'               => $this->type,
            'subject_type'       => $this->subject_type,
            'subject_id'         => $this->subject_id,
            'amount'             => $this->amount,
            'balance'            => $this->balance,
            'variable_symbol'    => (int)$this->variable_symbol,
            'specific_symbol'    => (int)$this->specific_symbol,
            'description'        => $this->description,
            'posted_at'          => (string)$this->posted_at,
            'created_at'         => (string)$this->created_at,
            'destination_iban'   => $this->destination_iban,
            'transaction_source' => new SourceResource($this->source)
        ];
    }
403480
protected function call($request)
    {
        if(!isset($request['query']))
        {
            $request['query'] = [];
        }

        $method  = 'GET';
        $headers = $this->getHeaders();
        $query   = http_build_query($request['query']);
        $url     = "{$this->domain}/{$request['route']}?$query";

        try {
            $request = $this->getClient()->request($method, $url, [
                'headers' => $headers
            ]);

            $response = $request->getBody()->getContents();

            return json_decode($response, true);

        } catch (RequestException $e) {
            $response = $e->getResponse();
            $response = json_decode($response, true);
            return $response;
        } catch (\Exception $e) {
            return ['error' => $e->getCode(), 'error_description' => $e->getMessage()];
        }
    }
736290
public function postAction(Request $request)
    {
        $data = array_merge(
            [
                'scheme' => $request->getScheme(),
                'host' => $request->getHost(),
            ],
            array_filter($request->request->all())
        );

        $manager = $this->getTaskManager();
        $task = $this->get('serializer')->deserialize(
            json_encode($data),
            Task::class,
            'json',
            DeserializationContext::create()->setGroups(['api'])
        );
        $task = $manager->create($task);

        $this->getEntityManager()->flush($task);

        return $this->handleView($this->view($task));
    }
850161
public function _invokeAsArray(array $request)
    {
        $factory = $this->factory;

        // Ensure headers are by reference. They're updated elsewhere.
        $result = $factory($request, $this->checkoutEasyHandle());
        $h = $result[0];
        $hd =& $result[1];
        $bd = $result[2];
        Core::doSleep($request);
        curl_exec($h);
        $response = ['transfer_stats' => curl_getinfo($h)];
        $response['curl']['error'] = curl_error($h);
        $response['curl']['errno'] = curl_errno($h);
        $response['transfer_stats'] = array_merge($response['transfer_stats'], $response['curl']);
        $this->releaseEasyHandle($h);

        return CurlFactory::createResponse([$this, '_invokeAsArray'], $request, $response, $hd, $bd);
    }
561800
public function filter($request): array
    {
        if (\is_array($request)) {
            return $request;
        } elseif ($request === '*') {
            return $this->get();
        } elseif ($request[0] === '!') {
            return \array_diff($this->get(), [\substr($request, 1)]);
        }

        return [$request];
    }
452481
public function execute($request)
    {
        RequestNotSupportedException::assertSupports($this, $request);
        $details = ArrayObject::ensureArrayObject($request->getModel());

        $httpRequest = new GetHttpRequest();
        $this->gateway->execute($httpRequest);

        if ($this->api->verifyHash($httpRequest->request) === false) {
            throw new HttpResponse('0|CheckMacValue verify fail.', 400, ['Content-Type' => 'text/plain']);
        }

        $details->replace($httpRequest->request);

        throw new HttpResponse('1|OK', 200, ['Content-Type' => 'text/plain']);
    }
1204351
public function execute($request)
    {
        RequestNotSupportedException::assertSupports($this, $request);
        $details = ArrayObject::ensureArrayObject($request->getModel());

        $httpRequest = new GetHttpRequest();
        $this->gateway->execute($httpRequest);

        // CVS
        if (isset($httpRequest->request['CVSStoreID']) === true ||
            isset($httpRequest->request['RtnCode']) === true ||
            isset($httpRequest->request['ResCode']) === true ||
            isset($httpRequest->request['RtnMerchantTradeNo']) === true && isset($httpRequest->request['RtnOrderNo']) === true ||
            isset($httpRequest->request['CVSStoreID']) === true ||
            isset($httpRequest->request['ErrorMessage']) === true
        ) {
            $details->replace($httpRequest->request);

            return;
        }

        $token = $request->getToken();
        $targetUrl = $token->getTargetUrl();

        if (empty($details['GoodsAmount']) === true) {
            if (empty($details['ServerReplyURL']) === true) {
                $details['ServerReplyURL'] = $targetUrl;
            }
            $this->gateway->execute(new CreateTransaction($details));

            return;
        }

        if (empty($details['ServerReplyURL']) === true) {
            $notifyToken = $this->tokenFactory->createNotifyToken(
                $token->getGatewayName(), $token->getDetails()
            );
            $details['ServerReplyURL'] = $notifyToken->getTargetUrl();
        }

        if (empty($details['LogisticsC2CReplyURL']) === true) {
            $details['LogisticsC2CReplyURL'] = $details['ServerReplyURL'];
        }

        if (empty($details['ClientReplyURL']) === true) {
            $details['ClientReplyURL'] = $targetUrl;
        }

        $this->gateway->execute(new CreateTransaction($details));
    }