mirror of
https://github.com/wiosna-dev/limesurvey-api-client.git
synced 2026-03-12 02:11:45 +01:00
Compare commits
6 Commits
prototype/
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7d1cc5384e | ||
|
|
e74f2e1a51 | ||
|
|
4f7a72dc0b | ||
|
|
13886da84d | ||
|
|
7c1ee7dfb8 | ||
|
|
59ebe2d236 |
@@ -12,7 +12,7 @@
|
||||
"require": {
|
||||
"php": ">=5.6",
|
||||
"fguillot/json-rpc": "^1.2",
|
||||
"wiosna-dev/common-library": "^0.1.9"
|
||||
"wiosna-dev/common-library": "^0.2.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"friendsofphp/php-cs-fixer": "^2.6",
|
||||
|
||||
@@ -57,14 +57,9 @@ class Result
|
||||
* class constants.
|
||||
* @param array $rawData Raw data returned by the LimeSurvey's API
|
||||
*/
|
||||
public function __construct($method, $rawData)
|
||||
public function __construct($method, array $rawData)
|
||||
{
|
||||
$this->method = MethodType::getValidatedMethod($method);
|
||||
|
||||
if (true === is_string($rawData)) {
|
||||
$rawData = base64_decode($rawData);
|
||||
$rawData = json_decode($rawData, true);
|
||||
}
|
||||
$this->setRawDataAndStatus($rawData);
|
||||
}
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@ use Meritoo\LimeSurvey\ApiClient\Result\Item\Survey;
|
||||
use Meritoo\LimeSurvey\ApiClient\Result\Item\SurveySummary;
|
||||
use Meritoo\LimeSurvey\ApiClient\Type\MethodType;
|
||||
use Meritoo\LimeSurvey\ApiClient\Type\ReasonType;
|
||||
use Meritoo\Common\Utilities\Date;
|
||||
|
||||
/**
|
||||
* Service that serves surveys and participants of surveys
|
||||
@@ -301,6 +302,7 @@ class SurveyService
|
||||
'firstname' => $firstName,
|
||||
'lastname' => $lastName,
|
||||
'email' => $email,
|
||||
'validfrom' => date('Y-m-d H:i:s'),
|
||||
],
|
||||
];
|
||||
|
||||
@@ -458,31 +460,4 @@ class SurveyService
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public function getResponseIds($surveyId, $token)
|
||||
{
|
||||
$arguments = [
|
||||
$surveyId,
|
||||
$token,
|
||||
];
|
||||
|
||||
return $this
|
||||
->client
|
||||
->run('get_response_ids', $arguments)
|
||||
->getData(true);
|
||||
}
|
||||
|
||||
public function exportResponsesByToken($surveyId, $token)
|
||||
{
|
||||
$arguments = [
|
||||
$surveyId,
|
||||
'json',
|
||||
$token,
|
||||
];
|
||||
|
||||
return $this
|
||||
->client
|
||||
->run('export_responses_by_token', $arguments)
|
||||
->getData(true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -93,10 +93,6 @@ class MethodType extends BaseType
|
||||
*/
|
||||
const LIST_USERS = 'list_users';
|
||||
|
||||
const EXPORT_RESPONSES_BY_TOKEN = 'export_responses_by_token';
|
||||
|
||||
const GET_RESPONSE_IDS = 'get_response_ids';
|
||||
|
||||
/**
|
||||
* Returns validated name of method to call or throws an exception (if method is incorrect)
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user