|
| 1 | +<?php |
| 2 | + |
| 3 | +/* |
| 4 | + * The SQLite driver uses PDO. Enable PDO function calls: |
| 5 | + * phpcs:disable WordPress.DB.RestrictedClasses.mysql__PDO |
| 6 | + */ |
| 7 | + |
| 8 | +class WP_PDO_Statement extends PDOStatement { |
| 9 | + /** @var PDOStatement */ |
| 10 | + private $stmt; |
| 11 | + |
| 12 | + public function __construct( |
| 13 | + ?PDOStatement $stmt |
| 14 | + ) { |
| 15 | + $this->stmt = $stmt; |
| 16 | + } |
| 17 | + |
| 18 | + public function execute( ?array $params = null ): bool { |
| 19 | + // TODO: Implement. |
| 20 | + return true; |
| 21 | + } |
| 22 | + |
| 23 | + public function columnCount(): int { |
| 24 | + return $this->stmt->columnCount(); |
| 25 | + } |
| 26 | + |
| 27 | + public function rowCount(): int { |
| 28 | + return $this->stmt->rowCount(); |
| 29 | + } |
| 30 | + |
| 31 | + #[ReturnTypeWillChange] |
| 32 | + public function fetch( int $mode = PDO::FETCH_DEFAULT, int $cursorOrientation = PDO::FETCH_ORI_NEXT, int $cursorOffset = 0 ) { |
| 33 | + } |
| 34 | + |
| 35 | + public function fetchAll( int $mode = PDO::FETCH_DEFAULT, ...$args ): array { |
| 36 | + } |
| 37 | + |
| 38 | + #[ReturnTypeWillChange] |
| 39 | + public function fetchColumn( int $column = 0 ) { |
| 40 | + return $this->stmt->fetchColumn( $column ); |
| 41 | + } |
| 42 | + |
| 43 | + #[ReturnTypeWillChange] |
| 44 | + public function fetchObject( ?string $class = 'stdClass', array $constructorArgs = array() ) { |
| 45 | + } |
| 46 | + |
| 47 | + public function getColumnMeta( int $column ): array { |
| 48 | + return array(); |
| 49 | + } |
| 50 | + |
| 51 | + public function errorCode(): ?string { |
| 52 | + return '00000'; |
| 53 | + } |
| 54 | + |
| 55 | + public function errorInfo(): array { |
| 56 | + return array( '00000', '00000', '00000' ); |
| 57 | + } |
| 58 | + |
| 59 | + // TODO: |
| 60 | + // public function bindColumn() |
| 61 | + // public function bindParam() |
| 62 | + // public function bindValue() |
| 63 | + // public function closeCursor() |
| 64 | + // public function debugDumpParams() |
| 65 | + // public function setFetchMode() |
| 66 | + // public function setAttribute() |
| 67 | + // public function getAttribute() |
| 68 | + // public function getIterator() |
| 69 | + // public function nextRowset() |
| 70 | +} |
0 commit comments