55 lines
1.1 KiB
PHP
55 lines
1.1 KiB
PHP
|
<?php
|
||
|
// NullDbResult.php
|
||
|
// Created: 2021-05-02
|
||
|
// Updated: 2022-02-16
|
||
|
|
||
|
namespace Index\Data\NullDb;
|
||
|
|
||
|
use Index\AString;
|
||
|
use Index\WString;
|
||
|
use Index\Data\IDbResult;
|
||
|
use Index\IO\Stream;
|
||
|
|
||
|
/**
|
||
|
* Represents a dummy database result.
|
||
|
*/
|
||
|
class NullDbResult implements IDbResult {
|
||
|
public function next(): bool {
|
||
|
return false;
|
||
|
}
|
||
|
|
||
|
public function isNull(int|string $index): bool {
|
||
|
return true;
|
||
|
}
|
||
|
|
||
|
public function getValue(int|string $index): mixed {
|
||
|
return null;
|
||
|
}
|
||
|
|
||
|
public function getString(int|string $index): string {
|
||
|
return '';
|
||
|
}
|
||
|
|
||
|
public function getAString(int|string $index): AString {
|
||
|
return AString::empty();
|
||
|
}
|
||
|
|
||
|
public function getWString(int|string $index, string $encoding): WString {
|
||
|
return WString::empty();
|
||
|
}
|
||
|
|
||
|
public function getInteger(int|string $index): int {
|
||
|
return 0;
|
||
|
}
|
||
|
|
||
|
public function getFloat(int|string $index): float {
|
||
|
return 0.0;
|
||
|
}
|
||
|
|
||
|
public function getStream(int|string $index): ?Stream {
|
||
|
return null;
|
||
|
}
|
||
|
|
||
|
public function close(): void {}
|
||
|
}
|