From 4dac432d75f2d00235d3690373a87b55d960a7d5 Mon Sep 17 00:00:00 2001 From: yakut Date: Tue, 20 Jan 2015 17:51:24 +0300 Subject: [PATCH] 0.2.0 --- Call/BaseCall.php | 10 +++++----- README.md | 11 +++++++++++ Resources/views/Call/testCall.html.twig | 2 +- Service/MakeCallService.php | 6 +++--- 4 files changed, 20 insertions(+), 9 deletions(-) diff --git a/Call/BaseCall.php b/Call/BaseCall.php index 5876a65..7d5213c 100644 --- a/Call/BaseCall.php +++ b/Call/BaseCall.php @@ -24,7 +24,7 @@ class BaseCall protected $mode = 0; // Sandbox by default protected $responseFormat = 'XML'; protected $keys = []; - protected $postFields; + protected $input; public function __construct(array $parameters) @@ -140,15 +140,15 @@ protected function getKeys() * @param string $value * @return $this */ - public function setPostFields($value) + public function setInput($value) { - $this->postFields = $value; + $this->input = $value; return $this; } - public function getPostFields() + public function getInput() { - return $this->postFields; + return $this->input; } } diff --git a/README.md b/README.md index 06238bf..e158dbf 100644 --- a/README.md +++ b/README.md @@ -65,6 +65,17 @@ $call $service = $this->get('web_consul_ebay_api.make_call'); $output = $service->getResponse($call); ``` +Typically, the query properties are set by the standard setter. +For more complex structures and containers created special types: + +* WebConsul\EbayApiBundle\Type + * Affiliate + * AspectFilter + * ItemFilter + * NameValueList + * PaginationInput + * ProductID + * RequesterCredentials Full documentation will be stored in the `Resources/doc/index.md` diff --git a/Resources/views/Call/testCall.html.twig b/Resources/views/Call/testCall.html.twig index b8f8251..52a3a0c 100644 --- a/Resources/views/Call/testCall.html.twig +++ b/Resources/views/Call/testCall.html.twig @@ -6,7 +6,7 @@ {% endfor %}

Input

-{{ dump(call.postFields) }} +{{ dump(call.input) }}

Output

{% autoescape %} diff --git a/Service/MakeCallService.php b/Service/MakeCallService.php index 02f9fdb..8dcca81 100644 --- a/Service/MakeCallService.php +++ b/Service/MakeCallService.php @@ -23,15 +23,15 @@ public function __construct(Serializer $serializer) public function getResponse(BaseCall $call) { - $postFields = $this->getPostFields($call); - $call->setPostFields($postFields); + $input = $this->getPostFields($call); + $call->setInput($input); $ch = curl_init($call->getRequestUrl()); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_HTTPHEADER, $call->getHeaders()); //set headers using the above array of headers - curl_setopt($ch, CURLOPT_POSTFIELDS, $postFields); + curl_setopt($ch, CURLOPT_POSTFIELDS, $input); if (isset($call->parameters['timeout'])) { curl_setopt($ch, CURLOPT_TIMEOUT, $call->parameters['timeout']); }