index/src/Data/NullDb/NullDbResult.php
2023-11-09 12:58:04 +00:00

45 lines
849 B
PHP

<?php
// NullDbResult.php
// Created: 2021-05-02
// Updated: 2023-11-09
namespace Index\Data\NullDb;
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 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 {}
}