just another orm...
View the Project on GitHub tflori/orm
» API Reference » ORM\QueryBuilder\ExecutesQueries
Hold all methods required from the query builder to execute queries.
public function all(): array<int,mixed>
Please note that this will execute the query - further modifications will not have any effect.
If the query fails you should get an exception. Anyway if we couldn’t get a result or there are no rows it returns an empty array.
Returns | array<int,mixed> |
ORM\QueryBuilder\ExecutesQueries::all
public function delete(): int
Returns | int | The number of deleted rows |
ORM\QueryBuilder\ExecutesQueries::delete
public function insert(array $rows): int
Returns | int | The number of inserted rows |
Parameter | Type | Description |
---|---|---|
$rows |
array |
ORM\QueryBuilder\ExecutesQueries::insert
public function one(): mixed|null
Please note that this will execute the query - further modifications will not have any effect.
If the query fails you should get an exception. Anyway if we couldn’t get a result or there are no more rows it returns null.
Returns | mixed|null |
ORM\QueryBuilder\ExecutesQueries::one
public function reset(): $this
Returns | $this |
ORM\QueryBuilder\ExecutesQueries::reset
public function setFetchMode(
int $mode,
int|string|object $classNameObject = null,
array $constructorArgs = null,
): $this
Please note that this will execute the query - further modifications will not have any effect.
Returns | $this |
Parameter | Type | Description | ||
---|---|---|---|---|
$mode |
int | one of the PDO::FETCH_ constants | ||
$classNameObject |
**int | string | object** | class (FETCH_CLASS), column number (FETCH_COLUMN), object (FETCH_INTO) |
$constructorArgs |
array | arguments to pass to the constructor (FETCH_CLASS) |
See Also:
ORM\QueryBuilder\ExecutesQueries::setFetchMode
public function update(array $updates): int
NOTE: not all drivers support UPDATE with JOIN (or FROM). Has to be implemented in the database abstraction layer.
$updates should be an array which columns to update with what value. Use expressions to bypass escaping.
Returns | int | The number of affected rows |
Parameter | Type | Description |
---|---|---|
$updates |
array | An array of columns to update |
ORM\QueryBuilder\ExecutesQueries::update