From 7d3b0ac7d06f157494131df1a99f15774dbe2210 Mon Sep 17 00:00:00 2001 From: Luca Plozner Date: Wed, 15 Jul 2026 12:33:13 +0200 Subject: [PATCH] Add __isset support for fields in FileMakerRelation Co-authored-by: Junie --- src/Supporting/FileMakerRelation.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/Supporting/FileMakerRelation.php b/src/Supporting/FileMakerRelation.php index fd6e71a..7ea48ab 100644 --- a/src/Supporting/FileMakerRelation.php +++ b/src/Supporting/FileMakerRelation.php @@ -16,6 +16,7 @@ * @property string $fieldName The field value named as the property name accessed via __get(). * @property FileMakerRelation $portalName A FileMakerRelation object associated with the property name accessed via __get(). * The table occurrence name of the portal can be the 'portalName', and also the object name of the portal. + * @method bool __isset(string $name) Check if a field or portal exists. * @version 36 * @author Masayuki Nii * @copyright 2017-2026 Masayuki Nii (Claris FileMaker is registered trademarks of Claris International Inc. in the U.S. and other countries.) @@ -217,6 +218,22 @@ public function __get($key) return $this->field($key); } + /** + * Handle the isset() function for the field or portal name. + * @param string $key The field or portal name. + * @return bool True if the field or portal exists. + * @ignore + */ + public function __isset(string $key): bool + { + try { + $this->field($key); + return true; + } catch (Exception $e) { + return false; + } + } + /** * Return the array of field names. *