[UW-2538] fixes method

This commit is contained in:
Michał Frankiewicz
2021-07-02 08:59:44 +02:00
parent bab7e25c85
commit 24f9a237ae

View File

@@ -432,9 +432,9 @@ class SurveyService
$arguments = [ $arguments = [
$surveyId, $surveyId,
$offset = 0, $offset = 0,
$limit = 1, $limit = 10,
$includeUnused = false, $includeUnused = false,
$attributes = false, ['completed'],
['email' => $email] ['email' => $email]
]; ];
@@ -443,9 +443,13 @@ class SurveyService
$participants = $this $participants = $this
->client ->client
->run(MethodType::LIST_PARTICIPANTS, $arguments) ->run(MethodType::LIST_PARTICIPANTS, $arguments)
->getData(); ->getData(true);
return $participants->count() > 0; foreach ($participants as $participant) {
if ('N' !== $participant['completed']) {
return true;
}
}
} catch (CannotProcessDataException $exception) { } catch (CannotProcessDataException $exception) {
if (ReasonType::NO_PARTICIPANTS_FOUND !== $exception->getReason()) { if (ReasonType::NO_PARTICIPANTS_FOUND !== $exception->getReason()) {
throw $exception; throw $exception;