Pdo
- Full name:
\Pseudo\Pdo - Parent class:
PDO
Properties
mockedQueries
private \Pseudo\ResultCollection $mockedQueries
inTransaction
private bool $inTransaction
queryLog
private \Pseudo\QueryLog $queryLog
Methods
__construct
public __construct(?\Pseudo\ResultCollection $collection = null): mixed
Parameters:
| Parameter | Type | Description |
|---|---|---|
$collection |
?\Pseudo\ResultCollection |
prepare
public prepare(string $query, array<int|string,mixed> $options = []): \Pseudo\PdoStatement
Parameters:
| Parameter | Type | Description |
|---|---|---|
$query |
string | |
$options |
array |
Throws:
beginTransaction
public beginTransaction(): bool
commit
public commit(): bool
rollBack
public rollBack(): bool
inTransaction
public inTransaction(): bool
exec
public exec(string $statement): false|int
Parameters:
| Parameter | Type | Description |
|---|---|---|
$statement |
string |
query
public query(string $query, int|null $fetchMode = null, mixed $fetchModeArgs): \Pseudo\PdoStatement
Parameters:
| Parameter | Type | Description |
|---|---|---|
$query |
string | |
$fetchMode |
int|null | |
$fetchModeArgs |
mixed |
Throws:
lastInsertId
public lastInsertId(string|null $name = null): string|false
Parameters:
| Parameter | Type | Description |
|---|---|---|
$name |
string|null |
Throws:
getLastResult
private getLastResult(): \Pseudo\Result|bool
Throws:
save
public save(string $filePath): void
Parameters:
| Parameter | Type | Description |
|---|---|---|
$filePath |
string |
load
public load(string $filePath): void
Parameters:
| Parameter | Type | Description |
|---|---|---|
$filePath |
string |
Throws:
mock
public mock(string $sql, array<int|string,mixed>|null $params = null, mixed $expectedResults = null): void
Parameters:
| Parameter | Type | Description |
|---|---|---|
$sql |
string | |
$params |
array |
|
$expectedResults |
mixed |
getMockedQueries
public getMockedQueries(): \Pseudo\ResultCollection
Automatically generated on 2025-05-14