# Query

final class Query implements IteratorAggregate, Countable

## Methods

__construct(string $sql = '', array $params = [], array $options = [])

No description

Query
prepare(string $sql = '', array $params = [], array $options = [])

Same as construct if you want to setup other property g.g connection before generating data

Query
setConnection(string $connectionName)

Switching connection

void
setDefaultOutput(int $output)

Output

first()

No description

last()

No description

bool
isAffected()

No description

run()

No description

int
lastInsertId()

No description

ArrayIterator
getIterator()

No description

int
count()

No description

array
jsonSerialize()

If Object inside json_encode

array
toArray()

Export data to Array

getError()

No description

string
__toString()

Extract object to string as json format

void
dump()

Review all data before generate by this library

## Details

###
at line 100
`__construct(string $sql = '', array $params = [], array $options = [])`

No description

#### Parameters

string | $sql |
array | $params |
array | $options |

###
at line 116
`Query prepare(string $sql = '', array $params = [], array $options = [])`

Same as construct if you want to setup other property g.g connection before generating data

#### Parameters

string | $sql |
array | $params |
array | $options |

#### Return Value

Query |

###
at line 140
`Query setConnection(string $connectionName)`

Switching connection

#### Parameters

string | $connectionName |

#### Return Value

Query |

###
at line 152
`void setDefaultOutput(int $output)`

Output

#### Parameters

int | $output |

#### Return Value

void |

###
at line 177
`first()`

No description

###
at line 182
`last()`

No description

###
at line 188
`bool isAffected()`

No description

#### Return Value

bool |

###
at line 193
`run()`

No description

###
at line 206
`int lastInsertId()`

No description

#### Return Value

int |

###
at line 222
`ArrayIterator getIterator()`

No description

#### Return Value

ArrayIterator |

###
at line 231
`int count()`

No description

#### Return Value

int |

###
at line 242
`array jsonSerialize()`

If Object inside json_encode

#### Return Value

array |

###
at line 253
`array toArray()`

Export data to Array

#### Return Value

array |

###
at line 259
`getError()`

No description

###
at line 269
`string __toString()`

Extract object to string as json format

#### Return Value

string |

###
at line 280
`void dump()`

Review all data before generate by this library

#### Return Value

void |