From f2f9e95d82d03c40398837f47cd7ff86a2be90e2 Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Thu, 24 Oct 2019 08:15:27 -0400 Subject: [PATCH] Use helper for checking items to get by name --- ext/afform/core/Civi/Api4/Action/Afform/Get.php | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/ext/afform/core/Civi/Api4/Action/Afform/Get.php b/ext/afform/core/Civi/Api4/Action/Afform/Get.php index 867cdc0d78..61da5f8d52 100644 --- a/ext/afform/core/Civi/Api4/Action/Afform/Get.php +++ b/ext/afform/core/Civi/Api4/Action/Afform/Get.php @@ -17,13 +17,7 @@ class Get extends BasicGetAction { /** @var \CRM_Afform_AfformScanner $scanner */ $scanner = \Civi::service('afform_scanner'); - $where = $this->getWhere(); - if (count($where) === 1 && $where[0][0] === 'name' && $where[0][1] == '=') { - $names = [$where[0][2]]; - } - else { - $names = array_keys($scanner->findFilePaths()); - } + $names = $this->_itemsToGet('name') ?? array_keys($scanner->findFilePaths()); $values = []; foreach ($names as $name) { -- 2.25.1