Skip to content

Add __isset magic method to FileMakerRelation for field existence checks#160

Open
ProgrammiererEFZ wants to merge 1 commit into
msyk:masterfrom
ProgrammiererEFZ:feature/isset-support-for-fields
Open

Add __isset magic method to FileMakerRelation for field existence checks#160
ProgrammiererEFZ wants to merge 1 commit into
msyk:masterfrom
ProgrammiererEFZ:feature/isset-support-for-fields

Conversation

@ProgrammiererEFZ

Copy link
Copy Markdown

Summary: This pull request adds support for the PHP isset() function when checking for fields or portals on a record object (FileMakerRelation).

Changes:

  • Implemented the __isset magic method in src/Supporting/FileMakerRelation.php.
  • The implementation uses the existing field() method to verify if a field or portal exists.
  • Returns true if the field exists and false if it does not (handling the Exception thrown by field()).

Reasoning: Currently, the library supports magic property access via __get, but calling isset($record->field_name) always returns false because __isset was not implemented. This change makes the API more intuitive and consistent with standard PHP object behavior, allowing developers to safely check for field existence before access.

Co-authored-by: Junie <junie@jetbrains.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant