From 089798f11e4036685aa6e4fe284d0165e06bc0bf Mon Sep 17 00:00:00 2001 From: Nikita Date: Mon, 6 Jul 2020 01:30:07 +0300 Subject: [PATCH] fix call toApi method with correct requestId if not given --- src/AmoCRM/Models/CallModel.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/AmoCRM/Models/CallModel.php b/src/AmoCRM/Models/CallModel.php index 6435d628..cd7a1bc2 100644 --- a/src/AmoCRM/Models/CallModel.php +++ b/src/AmoCRM/Models/CallModel.php @@ -105,6 +105,10 @@ public function toArray(): array */ public function toApi(?string $requestId = "0"): array { + if (is_null($this->getRequestId()) && !is_null($requestId)) { + $this->setRequestId($requestId); + } + return [ 'uniq' => $this->getUniq(), 'duration' => $this->getDuration(),