From c8ffcafbd83a76ea9da3ee40730b5fab310e8219 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Frankiewicz?= Date: Wed, 8 Jul 2020 08:55:14 +0200 Subject: [PATCH] [UW-2256] moves token property to BaseParticipant --- src/Base/Result/BaseParticipant.php | 17 +++++++++++++++++ src/Result/Item/Participant.php | 17 ----------------- src/Result/Item/ParticipantShort.php | 5 +++++ 3 files changed, 22 insertions(+), 17 deletions(-) diff --git a/src/Base/Result/BaseParticipant.php b/src/Base/Result/BaseParticipant.php index 9e03192..aad7317 100644 --- a/src/Base/Result/BaseParticipant.php +++ b/src/Base/Result/BaseParticipant.php @@ -39,6 +39,13 @@ abstract class BaseParticipant extends BaseItem */ protected $email; + /** + * Token of the participant + * + * @var string + */ + protected $token; + /** * Returns ID of the participant * @@ -78,4 +85,14 @@ abstract class BaseParticipant extends BaseItem { return $this->email; } + + /** + * Returns token of the participant + * + * @return string + */ + public function getToken() + { + return $this->token; + } } diff --git a/src/Result/Item/Participant.php b/src/Result/Item/Participant.php index eedba4d..6d681a1 100644 --- a/src/Result/Item/Participant.php +++ b/src/Result/Item/Participant.php @@ -42,13 +42,6 @@ class Participant extends BaseParticipant */ private $emailStatus; - /** - * Token of the participant - * - * @var string - */ - private $token; - /** * Language of the participant * @@ -232,16 +225,6 @@ class Participant extends BaseParticipant return $this->emailStatus; } - /** - * Returns token of the participant - * - * @return string - */ - public function getToken() - { - return $this->token; - } - /** * Returns language of the participant * diff --git a/src/Result/Item/ParticipantShort.php b/src/Result/Item/ParticipantShort.php index 0ede1fb..29637b9 100644 --- a/src/Result/Item/ParticipantShort.php +++ b/src/Result/Item/ParticipantShort.php @@ -28,6 +28,10 @@ class ParticipantShort extends BaseParticipant $this->id = (int)$value; break; + case 'token': + $this->token = trim($value); + break; + case 'participant_info': $this->firstName = trim($value['firstname']); $this->lastName = trim($value['lastname']); @@ -52,6 +56,7 @@ class ParticipantShort extends BaseParticipant $data = [ 'tid' => $participant->getId(), + 'token' => $participant->getToken(), 'participant_info' => $info, ];