aboutsummaryrefslogtreecommitdiffhomepage
path: root/services/app/src/Sql/Internal/SelectFirst.php
diff options
context:
space:
mode:
Diffstat (limited to 'services/app/src/Sql/Internal/SelectFirst.php')
-rw-r--r--services/app/src/Sql/Internal/SelectFirst.php26
1 files changed, 26 insertions, 0 deletions
diff --git a/services/app/src/Sql/Internal/SelectFirst.php b/services/app/src/Sql/Internal/SelectFirst.php
new file mode 100644
index 0000000..baf5aae
--- /dev/null
+++ b/services/app/src/Sql/Internal/SelectFirst.php
@@ -0,0 +1,26 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Albatross\Sql\Internal;
+
+/**
+ * @internal
+ */
+final class SelectFirst
+{
+ public function __construct(
+ private readonly Select $inner,
+ ) {
+ }
+
+ /**
+ * @param array<string, string|int> $params
+ * @return ?array<string, string>
+ */
+ public function execute(array $params = []): ?array
+ {
+ $result = $this->inner->execute($params);
+ return $result[0] ?? null;
+ }
+}