From b18bc644404e02b57635bfcc8258e85abb141146 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 13 Apr 2024 13:44:46 +0200 Subject: Adding upstream version 1.1.1. Signed-off-by: Daniel Baumann --- library/Icingadb/Util/ObjectSuggestionsCursor.php | 25 +++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 library/Icingadb/Util/ObjectSuggestionsCursor.php (limited to 'library/Icingadb/Util/ObjectSuggestionsCursor.php') diff --git a/library/Icingadb/Util/ObjectSuggestionsCursor.php b/library/Icingadb/Util/ObjectSuggestionsCursor.php new file mode 100644 index 0000000..0013b35 --- /dev/null +++ b/library/Icingadb/Util/ObjectSuggestionsCursor.php @@ -0,0 +1,25 @@ + $value) { + // TODO(lippserd): This is a quick and dirty fix for PostgreSQL binary datatypes for which PDO returns + // PHP resources that would cause exceptions since resources are not a valid type for attribute values. + // We need to do it this way as the suggestion implementation bypasses ORM behaviors here and there. + if (is_resource($value)) { + $value = stream_get_contents($value); + } + + yield $key => $value; + } + } +} -- cgit v1.2.3