summaryrefslogtreecommitdiff
path: root/vendor/doctrine/dbal/src/Portability/Result.php
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/doctrine/dbal/src/Portability/Result.php')
-rw-r--r--vendor/doctrine/dbal/src/Portability/Result.php68
1 files changed, 68 insertions, 0 deletions
diff --git a/vendor/doctrine/dbal/src/Portability/Result.php b/vendor/doctrine/dbal/src/Portability/Result.php
new file mode 100644
index 0000000..d158683
--- /dev/null
+++ b/vendor/doctrine/dbal/src/Portability/Result.php
@@ -0,0 +1,68 @@
1<?php
2
3declare(strict_types=1);
4
5namespace Doctrine\DBAL\Portability;
6
7use Doctrine\DBAL\Driver\Middleware\AbstractResultMiddleware;
8use Doctrine\DBAL\Driver\Result as ResultInterface;
9
10final class Result extends AbstractResultMiddleware
11{
12 /** @internal The result can be only instantiated by the portability connection or statement. */
13 public function __construct(ResultInterface $result, private readonly Converter $converter)
14 {
15 parent::__construct($result);
16 }
17
18 public function fetchNumeric(): array|false
19 {
20 return $this->converter->convertNumeric(
21 parent::fetchNumeric(),
22 );
23 }
24
25 public function fetchAssociative(): array|false
26 {
27 return $this->converter->convertAssociative(
28 parent::fetchAssociative(),
29 );
30 }
31
32 public function fetchOne(): mixed
33 {
34 return $this->converter->convertOne(
35 parent::fetchOne(),
36 );
37 }
38
39 /**
40 * {@inheritDoc}
41 */
42 public function fetchAllNumeric(): array
43 {
44 return $this->converter->convertAllNumeric(
45 parent::fetchAllNumeric(),
46 );
47 }
48
49 /**
50 * {@inheritDoc}
51 */
52 public function fetchAllAssociative(): array
53 {
54 return $this->converter->convertAllAssociative(
55 parent::fetchAllAssociative(),
56 );
57 }
58
59 /**
60 * {@inheritDoc}
61 */
62 public function fetchFirstColumn(): array
63 {
64 return $this->converter->convertFirstColumn(
65 parent::fetchFirstColumn(),
66 );
67 }
68}