Result
About 2 min
Result
- Full name:
\Hazaar\DBI\Result
- This class implements:
\Countable
,\Iterator
Properties
statement
private \PDOStatement $statement
record
private ?\Hazaar\DBI\Row $record
records
private array<int,\Hazaar\DBI\Row> $records
array_columns
private array<string,string[]> $array_columns
type_map
private array<string,mixed> $type_map
meta
private array $meta
adapter
private \Hazaar\DBI\Adapter $adapter
encrypt
private ?\Hazaar\Map $encrypt
reset
Flag to remember if we need to reset the statement when using array access methods.
private bool $reset
A reset is required once an 'execute' is made and then rows are accessed. If no rows are accessed then a reset is not required. This prevents a query from being executed multiple times when it's not necessary.
wakeup
private bool $wakeup
select_groups
private string[] $select_groups
fetch_mode
private int $fetch_mode
Methods
__construct
public __construct(\Hazaar\DBI\Adapter $adapter, \PDOStatement $statement): mixed
Parameters:
Parameter | Type | Description |
---|---|---|
$adapter | \Hazaar\DBI\Adapter | |
$statement | \PDOStatement |
__toString
public __toString(): string
__get
public __get(string $key): mixed
Parameters:
Parameter | Type | Description |
---|---|---|
$key | string |
__sleep
public __sleep(): mixed
__wakeup
public __wakeup(): mixed
setSelectGroups
public setSelectGroups(string[] $select_groups): void
Parameters:
Parameter | Type | Description |
---|---|---|
$select_groups | string[] |
hasSelectGroups
public hasSelectGroups(): bool
toString
public toString(): string
bindColumn
public bindColumn(int|string $column, mixed& $param, ?int $type = null, ?int $maxlen = null, mixed $driverdata = null): bool
Parameters:
Parameter | Type | Description |
---|---|---|
$column | int|string | |
$param | mixed | |
$type | ?int | |
$maxlen | ?int | |
$driverdata | mixed |
bindParam
public bindParam(int|string $parameter, mixed& $variable, int $data_type = PDO::PARAM_STR, ?int $length = null, mixed $driver_options = null): bool
Parameters:
Parameter | Type | Description |
---|---|---|
$parameter | int|string | |
$variable | mixed | |
$data_type | int | |
$length | ?int | |
$driver_options | mixed |
bindValue
public bindValue(int|string $parameter, mixed $value, int $data_type = PDO::PARAM_STR): bool
Parameters:
Parameter | Type | Description |
---|---|---|
$parameter | int|string | |
$value | mixed | |
$data_type | int |
closeCursor
public closeCursor(): bool
columnCount
public columnCount(): int
debugDumpParams
public debugDumpParams(): void
errorCode
public errorCode(): string
errorInfo
public errorInfo(): array<int,string>
execute
public execute(string[] $input_parameters = []): bool
Parameters:
Parameter | Type | Description |
---|---|---|
$input_parameters | string[] |
fetch
public fetch(?int $fetch_style = null, int $cursor_orientation = PDO::FETCH_ORI_NEXT, int $cursor_offset): null|array
Parameters:
Parameter | Type | Description |
---|---|---|
$fetch_style | ?int | |
$cursor_orientation | int | |
$cursor_offset | int |
fetchAll
public fetchAll(?int $fetch_mode = null, mixed $fetch_argument = null): array
Parameters:
Parameter | Type | Description |
---|---|---|
$fetch_mode | ?int | |
$fetch_argument | mixed |
fetchColumn
public fetchColumn(int $column_number): mixed
Parameters:
Parameter | Type | Description |
---|---|---|
$column_number | int |
fetchObject
public fetchObject(string $class_name = 'stdClass', array $constructorArgs = []): false|object
Parameters:
Parameter | Type | Description |
---|---|---|
$class_name | string | |
$constructorArgs | array |
getAttribute
public getAttribute(int $attribute): mixed
Parameters:
Parameter | Type | Description |
---|---|---|
$attribute | int |
getColumnMeta
public getColumnMeta(?string $column = null): mixed
Parameters:
Parameter | Type | Description |
---|---|---|
$column | ?string |
nextRowset
public nextRowset(): bool
rowCount
public rowCount(): int
count
public count(): int
setAttribute
public setAttribute(int $attribute, mixed $value): bool
Parameters:
Parameter | Type | Description |
---|---|---|
$attribute | int | |
$value | mixed |
setFetchMode
public setFetchMode(int $mode): bool
Parameters:
Parameter | Type | Description |
---|---|---|
$mode | int |
all
public all(): array
row
public row(int $cursor_orientation = PDO::FETCH_ORI_NEXT, int $offset): ?\Hazaar\DBI\Row
Parameters:
Parameter | Type | Description |
---|---|---|
$cursor_orientation | int | |
$offset | int |
rows
public rows(): \Hazaar\DBI\Row[]
current
public current(): \Hazaar\DBI\Row
key
public key(): null|int|string
next
public next(): void
rewind
public rewind(): void
valid
public valid(): bool
collate
Collates a result into a simple key/value array.
public collate(int|string $index_column, int|string $value_column, int|string $group_column = null): array
This is useful for generating SELECT lists directly from a resultset.
Parameters:
Parameter | Type | Description |
---|---|---|
$index_column | int|string | the column to use as the array index |
$value_column | int|string | the column to use as the array value |
$group_column | int|string | optional column name to group items by |
processStatement
private processStatement(\PDOStatement $statement): bool
Parameters:
Parameter | Type | Description |
---|---|---|
$statement | \PDOStatement |
fix
private fix(array& $record): void
Parameters:
Parameter | Type | Description |
---|---|---|
$record | array |
store
private store(): void
decrypt
private decrypt(array& $data): void
Parameters:
Parameter | Type | Description |
---|---|---|
$data | array |
Automatically generated on 2024-11-14