AloFramework documentation
  • Namespace
  • Class
  • Tree
  • Deprecated
  • Todo

Namespaces

  • Alo
    • Cache
    • CLI
    • Controller
    • Db
      • Query
    • Exception
    • FileSystem
    • Session
    • Traversables
    • Validators
    • Windows
  • Controller
  • None
  • PHP

Classes

  • AbstractQuery
  • MySQLQuery

Class AbstractQuery

Abstract ORM

Direct known subclasses

Alo\Db\Query\MySQLQuery

Abstract
Namespace:Alo\Db\Query
Author:Art <a.molcanovas@gmail.com>
Located atsys/class/alo/db/query/abstractquery.php

Methods summary

publicAlo\Db\Query\AbstractQuery
#reset( )

Resets the query settings

Resets the query settings

Returns

Alo\Db\Query\AbstractQuery
publicAlo\Db\Query\AbstractQuery
#from(string$table)

Sets the table to select from

Sets the table to select from

Parameters

$table
string
$table Table name

Returns

Alo\Db\Query\AbstractQuery

Throws

ORMEx
When $table isn't scalar

Author

Art <a.molcanovas@gmail.com>
abstract public string
#getSQL( )

Returns a string representation of the built query

Returns a string representation of the built query

Returns

string

Author

Art <a.molcanovas@gmail.com>
publicAlo\Db\Query\AbstractQuery
#innerJoin(string$table,string$on)

Sets an INNER JOIN

Sets an INNER JOIN

Parameters

$table
string
$table Table to join
$on
string
$on ON condition

Returns

Alo\Db\Query\AbstractQuery

Throws

Alo\Exception\ORMException
When $table or $on isn't a string

Author

Art <a.molcanovas@gmail.com>
protectedAlo\Db\Query\AbstractQuery
#abstractJoin(string$table,string$on,string$type)

The abstract joining method

The abstract joining method

Parameters

$table
string
$table Table to join
$on
string
$on ON condition
$type
string
$type JOIN type

Returns

Alo\Db\Query\AbstractQuery

Throws

Alo\Exception\ORMException
When $table or $on isn't a string

Author

Art <a.molcanovas@gmail.com>
publicAlo\Db\Query\AbstractQuery
#crossJoin(string$table)

Performs a CROSS JOIN

Performs a CROSS JOIN

Parameters

$table
string
$table Table to join

Returns

Alo\Db\Query\AbstractQuery

Throws

Alo\Exception\ORMException
When $table isn't a string

Author

Art <a.molcanovas@gmail.com>
publicAlo\Db\Query\AbstractQuery
#leftJoin(string$table,string$on)

performs a LEFT JOIN

performs a LEFT JOIN

Parameters

$table
string
$table Table to join
$on
string
$on ON condition

Returns

Alo\Db\Query\AbstractQuery

Throws

Alo\Exception\ORMException
When $table or $on isn't a string

Author

Art <a.molcanovas@gmail.com>
publicAlo\Db\Query\AbstractQuery
#rightJoin(string$table,string$on)

performs a RIGHT JOIN

performs a RIGHT JOIN

Parameters

$table
string
$table Table to join
$on
string
$on ON condition

Returns

Alo\Db\Query\AbstractQuery

Throws

Alo\Exception\ORMException
When $table or $on isn't a string

Author

Art <a.molcanovas@gmail.com>
publicAlo\Db\Query\AbstractQuery
#andWhere(string$column,string$modifier,string$value,boolean$bind=true)

Adds a WHERE clause. If it's not the first WHERE clause, they will be linked by AND

Adds a WHERE clause. If it's not the first WHERE clause, they will be linked by AND

Parameters

$column
string
$column WHERE $column
$modifier
string
$modifier WHERE $column $modifier
$value
string
$value WHERE $column $modifier $value
$bind
boolean
$bind Whether to use PDO parameter binding. It is HIGHLY discouraged to set this to false.

Returns

Alo\Db\Query\AbstractQuery

Author

Art <a.molcanovas@gmail.com>
protectedAlo\Db\Query\AbstractQuery
#abstractWhere(string$column,string$modifier,string$value,boolean$bind,string$kind)

The abstract WHERE builder

The abstract WHERE builder

Parameters

$column
string
$column WHERE $column
$modifier
string
$modifier WHERE $column $modifier
$value
string
$value WHERE $column $modifier $value
$bind
boolean
$bind Whether to use PDO parameter binding. It is HIGHLY discouraged to set this to false.
$kind
string
$kind OR/AND (how to link multiple WHEREs)

Returns

Alo\Db\Query\AbstractQuery

Author

Art <a.molcanovas@gmail.com>
publicAlo\Db\Query\AbstractQuery
#orWhere(string$column,string$modifier,string$value,boolean$bind=true)

Adds a WHERE clause. If it's not the first WHERE clause, they will be linked by OR

Adds a WHERE clause. If it's not the first WHERE clause, they will be linked by OR

Parameters

$column
string
$column WHERE $column
$modifier
string
$modifier WHERE $column $modifier
$value
string
$value WHERE $column $modifier $value
$bind
boolean
$bind Whether to use PDO parameter binding. It is HIGHLY discouraged to set this to false.

Returns

Alo\Db\Query\AbstractQuery

Author

Art <a.molcanovas@gmail.com>
publicAlo\Db\Query\AbstractQuery
#whereBracketOpen( )

Opens a bracket in the WHERE clause

Opens a bracket in the WHERE clause

Returns

Alo\Db\Query\AbstractQuery

Author

Art <a.molcanovas@gmail.com>
publicAlo\Db\Query\AbstractQuery
#whereBracketClose( )

Closes the bracket in the WHERE clause

Closes the bracket in the WHERE clause

Returns

Alo\Db\Query\AbstractQuery

Author

Art <a.molcanovas@gmail.com>
publicAlo\Db\Query\AbstractQuery
#select(string|array$col)

Adds a column or array of columns to the SELECT clause

Adds a column or array of columns to the SELECT clause

Parameters

$col
string|array
$col The column or array of columns

Returns

Alo\Db\Query\AbstractQuery

Throws

Alo\Exception\ORMException
When $col isn't a string or array of strings

Author

Art <a.molcanovas@gmail.com>
publicAlo\Db\Query\AbstractQuery
#limit(integer$limit1,integer|null$limit2=null)

Sets the LIMIT clause

Sets the LIMIT clause

Parameters

$limit1
integer
$limit1 If $limit2 is not passed, the maximum amount of rows to return, otherwise the return start index desired
$limit2
integer|null
$limit2 The max amount of rows to return

Returns

Alo\Db\Query\AbstractQuery

Throws

Alo\Exception\ORMException
When $limit1 or $limit2 are not integers

Author

Art <a.molcanovas@gmail.com>
public array
#getBinds( )

Returns the list of bound parameters

Returns the list of bound parameters

Returns

array

Author

Art <a.molcanovas@gmail.com>
public string
#__toString( )

Returns a string representation of the built query

Returns a string representation of the built query

Returns

string

Author

Art <a.molcanovas@gmail.com>

Magic methods summary

Properties summary

protected array$binds
#

Bound parameters

Bound parameters

protected string$limit
#

The LIMIT clause

The LIMIT clause

protected array$joins
#

JOINs to perform

JOINs to perform

protected array$select
#

Columns to select

Columns to select

protected array$where
#

Where clauses

Where clauses

protected string$from
#

Table to select from

Table to select from

AloFramework documentation API documentation generated byApiGen 2.8.0