Participants collection - store instances of ParticipantShort instead of Participant

Required to fix bug "Call to undefined method Meritoo\LimeSurvey\ApiClient\Result\Item\ParticipantShort::isCompleted() in /src/Service/ParticipantService.php on line 206"
This commit is contained in:
Meritoo
2017-10-01 11:46:59 +02:00
parent 54bd0ca114
commit 41156ed058
5 changed files with 59 additions and 24 deletions

View File

@@ -128,7 +128,11 @@ class Result
->getResultProcessor()
->process($this->method, $rawData);
if (null === $processed || is_array($processed)) {
/*
* Result is unknown and it should be iterable the result is an array?
* Let's prepare and return collection
*/
if ((null === $processed && MethodType::isResultIterable($this->method)) || is_array($processed)) {
$collection = new Collection();
if (is_array($processed)) {