mirror of
https://github.com/wiosna-dev/limesurvey-api-client.git
synced 2026-03-12 02:11:45 +01:00
ResultProcessor - add support of the "add_participants" method
This commit is contained in:
@@ -81,6 +81,7 @@ class ResultProcessor
|
|||||||
$method = MethodType::getValidatedMethod($method);
|
$method = MethodType::getValidatedMethod($method);
|
||||||
|
|
||||||
switch ($method) {
|
switch ($method) {
|
||||||
|
case MethodType::ADD_PARTICIPANTS:
|
||||||
case MethodType::GET_PARTICIPANT_PROPERTIES:
|
case MethodType::GET_PARTICIPANT_PROPERTIES:
|
||||||
$item = new Participant();
|
$item = new Participant();
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -19,6 +19,16 @@ use Meritoo\LimeSurvey\ApiClient\Exception\UnknownMethodException;
|
|||||||
*/
|
*/
|
||||||
class MethodType extends BaseType
|
class MethodType extends BaseType
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* Add participants to the tokens collection of the survey
|
||||||
|
*
|
||||||
|
* Returns the inserted data including additional new information like the Token entry ID and the token string.
|
||||||
|
* In case of errors in some data, return it in errors.
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
const ADD_PARTICIPANTS = 'add_participants';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add a response to the survey responses collection.
|
* Add a response to the survey responses collection.
|
||||||
* Returns the id of the inserted survey response.
|
* Returns the id of the inserted survey response.
|
||||||
@@ -104,6 +114,7 @@ class MethodType extends BaseType
|
|||||||
$method = static::getValidatedMethod($method);
|
$method = static::getValidatedMethod($method);
|
||||||
|
|
||||||
return in_array($method, [
|
return in_array($method, [
|
||||||
|
static::ADD_PARTICIPANTS,
|
||||||
static::LIST_PARTICIPANTS,
|
static::LIST_PARTICIPANTS,
|
||||||
static::LIST_QUESTIONS,
|
static::LIST_QUESTIONS,
|
||||||
static::LIST_SURVEYS,
|
static::LIST_SURVEYS,
|
||||||
|
|||||||
@@ -162,6 +162,7 @@ class MethodTypeTest extends BaseTypeTestCase
|
|||||||
protected function getAllExpectedTypes()
|
protected function getAllExpectedTypes()
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
|
'ADD_PARTICIPANTS' => MethodType::ADD_PARTICIPANTS,
|
||||||
'ADD_RESPONSE' => MethodType::ADD_RESPONSE,
|
'ADD_RESPONSE' => MethodType::ADD_RESPONSE,
|
||||||
'EXPORT_STATISTICS' => MethodType::EXPORT_STATISTICS,
|
'EXPORT_STATISTICS' => MethodType::EXPORT_STATISTICS,
|
||||||
'GET_PARTICIPANT_PROPERTIES' => MethodType::GET_PARTICIPANT_PROPERTIES,
|
'GET_PARTICIPANT_PROPERTIES' => MethodType::GET_PARTICIPANT_PROPERTIES,
|
||||||
|
|||||||
Reference in New Issue
Block a user