From 963c1d6576de5bf6061552edef805e74498620e5 Mon Sep 17 00:00:00 2001 From: Nikita Zarubin Date: Wed, 22 Jun 2022 10:47:17 +0300 Subject: [PATCH] master --- models/response/Certificate.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/models/response/Certificate.php b/models/response/Certificate.php index 51b22e4..fb6bba6 100644 --- a/models/response/Certificate.php +++ b/models/response/Certificate.php @@ -254,4 +254,24 @@ public function getDocumentById(string $documentId): ?Document } return null; } + + + + /** + * Получить значение поля анкеты, если оно существует (и если значение задано) + * + * + * @param string $fieldId ID поля + * @return mixed|null + */ + public function getFieldValue(string $fieldId): mixed + { + foreach ($this->fields as $field) { + if ($field->id == $fieldId) { + return $field->value; + } + } + + return null; + } }