Koowa_Database
[ class tree: Koowa_Database ] [ index: Koowa_Database ] [ all elements ]

Class: KDatabaseQuery

Source Location: /libraries/koowa/database/query/query.php

Class Overview


Database Select Class for database select statement generation


Author(s):

Variables

Methods



Class Details

[line 18]
Database Select Class for database select statement generation



Tags:

author:  Johan Janssens <johan@nooku.org>


[ Top ]


Class Variables

$columns = array()

[line 39]

The columns



Tags:

access:  public

Type:   array


[ Top ]

$count =  false

[line 25]

Count operation



Tags:

access:  public

Type:   boolean


[ Top ]

$distinct =  false

[line 32]

Distinct operation



Tags:

access:  public

Type:   boolean


[ Top ]

$from = array()

[line 46]

The from element



Tags:

access:  public

Type:   array


[ Top ]

$group = array()

[line 67]

The group element



Tags:

access:  public

Type:   array


[ Top ]

$having = array()

[line 74]

The having element



Tags:

access:  public

Type:   array


[ Top ]

$join = array()

[line 53]

The join element



Tags:

access:  public

Type:   array


[ Top ]

$limit =  null

[line 88]

The limit element



Tags:

access:  public

Type:   integer


[ Top ]

$offset =  null

[line 95]

The limit offset element



Tags:

access:  public

Type:   integer


[ Top ]

$order = array()

[line 81]

The order element



Tags:

access:  public

Type:   string


[ Top ]

$where = array()

[line 60]

The where element



Tags:

access:  public

Type:   array


[ Top ]

$_adapter =

[line 102]

Database connector



Tags:

access:  protected

Type:   object


[ Top ]

$_prefix =

[line 109]

Table prefix



Tags:

access:  protected

Type:   object


[ Top ]



Class Methods


constructor __construct [line 118]

KDatabaseQuery __construct( $config)

Object constructor

Can be overloaded/supplemented by the child class




Tags:

access:  public


Parameters:

object An   $config   optional KConfig object with configuration options.

[ Top ]

method count [line 184]

KDatabaseQuery count( )

Built a count query



Tags:

access:  public


[ Top ]

method distinct [line 196]

KDatabaseQuery distinct( )

Make the query distinct



Tags:

access:  public


[ Top ]

method from [line 208]

KDatabaseQuery from( array|string $tables)

Built the from clause of the query



Tags:

access:  public


Parameters:

array|string   $tables   A string or array of table names

[ Top ]

method getAdapter [line 148]

KDatabaseAdapterInterface getAdapter( )

Gets the database adapter for this particular KDatabaseQuery object.



Tags:

access:  public


[ Top ]

method group [line 298]

KDatabaseQuery group( array|string $columns)

Built the group clause of the query



Tags:

access:  public


Parameters:

array|string   $columns   A string or array of ordering columns

[ Top ]

method having [line 312]

KDatabaseQuery having( array|string $columns)

Built the having clause of the query



Tags:

access:  public


Parameters:

array|string   $columns   A string or array of ordering columns

[ Top ]

method join [line 235]

KDatabaseQuery join( string $type, string $table, string|array $condition)

Built the join clause of the query



Tags:

access:  public


Parameters:

string   $type   The type of join; empty for a plain JOIN, or "LEFT", "INNER", etc.
string   $table   The table name to join to.
string|array   $condition   Join on this condition.

[ Top ]

method limit [line 349]

KDatabaseQuery limit( integer $limit, [integer $offset = 0])

Built the limit element of the query



Tags:

access:  public


Parameters:

integer   $limit   Number of items to fetch.
integer   $offset   Offset to start fetching at.

[ Top ]

method order [line 327]

KDatabaseQuery order( array|string $columns, [string $direction = 'ASC'])

Build the order clause of the query



Tags:

access:  public


Parameters:

array|string   $columns   A string or array of ordering columns
string   $direction   Either DESC or ASC

[ Top ]

method select [line 171]

KDatabaseQuery select( [array|string $columns = '*'])

Built a select query



Tags:

access:  public


Parameters:

array|string   $columns   A string or an array of column names

[ Top ]

method setAdapter [line 159]

KDatabaseQuery setAdapter( KDatabaseAdapterInterface $adapter)

Set the database adapter for this particular KDatabaseQuery object.



Tags:

access:  public


Parameters:

object A   $adapter   KDatabaseAdapterInterface object

[ Top ]

method where [line 264]

KDatabaseQuery where( string $property, [string $constraint = null], [string|array $value = null], [string $condition = 'AND'])

Built the where clause of the query



Tags:

access:  public


Parameters:

string   $property   The name of the property the constraint applies too, or a SQL function or statement
string   $constraint   The comparison used for the constraint
string|array   $value   The value compared to the property value using the constraint
string   $condition   The where condition, defaults to 'AND'

[ Top ]

method _initialize [line 136]

void _initialize( $config)

Initializes the options for the object



Tags:

access:  protected


Parameters:

object An   $config   optional KConfig object with configuration options.

[ Top ]

method __toString [line 362]

string __toString( )

Render the query to a string



Tags:

return:  The completed query
access:  public


[ Top ]


Documentation generated on Thu, 23 May 2013 03:03:01 +0200 by phpDocumentor 1.4.3