Query

Query class

This class holds all the information regarding SELECT operation, that will be used by Database class.

package

Default

Methods

__construct

__construct(string $table) : void

Arguments

$table

string

Name of the database table where the SELECT operation will happen

exec

exec() : array

Execute the constructed SELECT operation

Response

array

limit

limit(integer $limit) : \TinyORM\Query

Add LIMIT in this SELECT operation

Arguments

$limit

integer

Response

\TinyORM\Query

offset

offset(integer $offset) : \TinyORM\Query

Add OFFSET in this SELECT operation

Arguments

$offset

integer

Response

\TinyORM\Query

orderBy

orderBy(string $column, string $dir = 'ASC') : \TinyORM\Query

Add ORDER BY in this SELECT operation

Arguments

$column

string

$dir

string

Response

\TinyORM\Query

toString

toString() : string

Return the SQL query

Response

string

where

where(string $column, string $operator, string $value = '') : \TinyORM\Query

Add where condition in this SELECT operation

Arguments

$column

string

Name of the database table column

$operator

string

SQL operator =, <, >, <> etc

$value

string

Value to the compared with the value in $column and $operator

Response

\TinyORM\Query

Properties

Database table

table : string
var

Database table

Type(s)

string

Query LIMIT

limit : integer
var

Query LIMIT

Type(s)

integer

Query OFFSET

offset : integer
var

Query OFFSET

Type(s)

integer

Query WHERE conditions

where : array
var

Query WHERE conditions

Type(s)

array

Query ORDER BY

orderBys : array
var

Query ORDER BY

Type(s)

array