Mental Space

QueryFactory
in package

FinalYes

Factory.

Table of Contents

Properties

$connection  : Connection

Methods

__construct()  : mixed
The constructor.
newDelete()  : Query
Create a 'delete' query for the given table.
newInsert()  : Query
Create an 'update' statement for the given table.
newSelect()  : Query
Create a new 'select' query for the given table.
newUpdate()  : Query
Create an 'update' statement for the given table.
rawQuery()  : mixed

Properties

Methods

__construct()

The constructor.

public __construct(Connection $connection) : mixed
Parameters
$connection : Connection

The database connection

newDelete()

Create a 'delete' query for the given table.

public newDelete(string $table) : Query
Parameters
$table : string

The table to delete from

Return values
Query

A new delete query

newInsert()

Create an 'update' statement for the given table.

public newInsert(string $table, array<string|int, mixed> $data) : Query
Parameters
$table : string

The table to update rows from

$data : array<string|int, mixed>

The values to be updated

Return values
Query

The new insert query

newSelect()

Create a new 'select' query for the given table.

public newSelect(array<string|int, mixed> $fields, string $table) : Query
Parameters
$fields : array<string|int, mixed>
$table : string

The table name

Tags
throws
RuntimeException
Return values
Query

A new select query

newUpdate()

Create an 'update' statement for the given table.

public newUpdate(string $table, array<string|int, mixed> $data) : Query
Parameters
$table : string

The table to update rows from

$data : array<string|int, mixed>

The values to be updated

Return values
Query

The new update query

rawQuery()

public rawQuery(mixed $q) : mixed
Parameters
$q : mixed

        
On this page

Search results