diff --git a/docs/classes/Query.Abstract_Query_Builder.html b/docs/classes/Query.Abstract_Query_Builder.html index 609cd2c..63a7eea 100644 --- a/docs/classes/Query.Abstract_Query_Builder.html +++ b/docs/classes/Query.Abstract_Query_Builder.html @@ -114,12 +114,12 @@ @@ -139,59 +139,37 @@
- + \
-
+
- + Query
-
+
- -
-
-
- + Driver
-
+
- + SQL
-
+
@@ -211,10 +189,10 @@
- + Util
-
+
@@ -249,8 +227,8 @@ @@ -297,18 +275,24 @@
- __call()
+ No public methods found
$conn_name
$queries
+ $db
+ $util
+ $sql
- No constants found + KEY
+ VALUE
+ BOTH
+ _mixed_set()
_select()
_get_compile()
_like()
@@ -338,6 +322,7 @@ $query_map
$having_map
$explain
+ $parser
N/A @@ -388,7 +373,96 @@
- + +
+
+

Constants

+
+ +
+ +
+
+ +
+

KEY

+
KEY
+

+ +
+
+ +
+ +
+
+ +
+

VALUE

+
VALUE
+

+ +
+
+ +
+ +
+
+ +
+

BOTH

+
BOTH
+

+ +
+
+ +
+ +
@@ -457,6 +531,96 @@
+
+
+ + +
+ +
+ +
+
+ +
+

$util

+
$util : \Query\Driver\Abstract_Util
+

Alias to driver util class

+ + +

Type

+ \Query\Driver\Abstract_Util +
+
+ +
+ +
+
+ +
+

$sql

+
$sql : \Query\Driver\SQL_Interface
+

Alias to driver sql class

+ + +

Type

+ \Query\Driver\SQL_Interface +
+
+ +
+
@@ -913,6 +1077,36 @@ array(

+
+
+ +
+

$parser

+
$parser : \Query\Query_Parser
+

Query parser class instance

+ + +

Type

+ \Query\Query_Parser +
+
+ +
+
@@ -920,38 +1114,43 @@ array(

-
+
- +
-

__call()

+

_mixed_set()

-
__call(string $name, array $params) : mixed
-

Calls a function further down the inheritence chain

+
_mixed_set(array $var, mixed $key, mixed $val, int $val_type) : array
+

Set values in the class, with either an array or key value pair

Parameters

- - + + - - + + + + + + + + + + + +
string$namearray$var
array$paramsmixed$key
mixed$val
int$val_type
-

Throws

-
-
\BadMethodCallException
-
-

Returns

- mixed + array
-
+
@@ -1633,7 +1832,7 @@ array(


Documentation is powered by phpDocumentor and authored - on April 24th, 2014 at 17:07. + on August 8th, 2014 at 12:45.
diff --git a/docs/classes/Query.BadDBDriverException.html b/docs/classes/Query.BadDBDriverException.html index acd4e64..73f7843 100644 --- a/docs/classes/Query.BadDBDriverException.html +++ b/docs/classes/Query.BadDBDriverException.html @@ -114,12 +114,12 @@ @@ -139,59 +139,37 @@
- + \
-
+
- + Query
-
+
- -
-
-
- + Driver
-
+
- + SQL
-
+
@@ -211,10 +189,10 @@
- + Util
-
+
@@ -249,8 +227,8 @@ @@ -335,7 +313,7 @@
File
-
core/connection_manager.php
+
core/BadDBDriverException.php
Package
\Query\Core\Core
Class hierarchy
@@ -371,10 +349,10 @@ @@ -415,7 +393,7 @@

Documentation is powered by phpDocumentor and authored - on April 24th, 2014 at 17:07. + on August 8th, 2014 at 12:45.
diff --git a/docs/classes/Query.Connection_Manager.html b/docs/classes/Query.Connection_Manager.html index b042336..bc75e55 100644 --- a/docs/classes/Query.Connection_Manager.html +++ b/docs/classes/Query.Connection_Manager.html @@ -114,12 +114,12 @@ @@ -139,59 +139,37 @@
- + \
-
+
- + Query
-
+
- -
-
-
- + Driver
-
+
- + SQL
-
+
@@ -211,10 +189,10 @@
- + Util
-
+
@@ -249,8 +227,8 @@ @@ -540,14 +518,14 @@ Query method

connect()

-
connect(\ArrayObject $params) : \Query\Query_Builder
+
connect(\stdClass $params) : \Query\Query_Builder

Parse the passed parameters and return a connection

Parameters

- + @@ -703,14 +681,14 @@ Query method

parse_params()

-
parse_params(\ArrayObject $params) : array
+
parse_params(\stdClass $params) : array

Parses params into a dsn and option array

Parameters

\ArrayObject\stdClass $params
- + @@ -749,7 +727,7 @@ Query method

create_dsn()

-
create_dsn(string $dbtype, \ArrayObject $params) : string
+
create_dsn(string $dbtype, \stdClass $params) : string

Create the dsn from the db type and params

@@ -761,7 +739,7 @@ Query method

- + @@ -839,7 +817,7 @@ Query method


Documentation is powered by phpDocumentor and authored - on April 24th, 2014 at 17:07. + on August 8th, 2014 at 12:45.
diff --git a/docs/classes/Query.Driver.Abstract_Driver.html b/docs/classes/Query.Driver.Abstract_Driver.html index 45511d0..72ede65 100644 --- a/docs/classes/Query.Driver.Abstract_Driver.html +++ b/docs/classes/Query.Driver.Abstract_Driver.html @@ -114,12 +114,12 @@ @@ -139,59 +139,37 @@
- + \
-
+
- + Query
-
+
- -
-
-
- + Driver
-
+
- + SQL
-
+
@@ -211,10 +189,10 @@
- + Util
-
+
@@ -249,8 +227,8 @@ @@ -412,12 +390,12 @@

$sql

-
$sql : \Query\Driver\SQL_Interface
+
$sql : \Query\Driver\SQL\SQL_Interface

Reference to sql class

Type

- \Query\Driver\SQL_Interface + \Query\Driver\SQL\SQL_Interface
\ArrayObject\stdClass $params
\ArrayObject\stdClass $params
@@ -774,7 +748,7 @@

Documentation is powered by phpDocumentor and authored - on April 24th, 2014 at 17:07. + on August 8th, 2014 at 12:45.
diff --git a/docs/classes/Query.Driver.Util.Firebird_Util.html b/docs/classes/Query.Driver.Util.Firebird_Util.html index b9d7b50..3f9978a 100644 --- a/docs/classes/Query.Driver.Util.Firebird_Util.html +++ b/docs/classes/Query.Driver.Util.Firebird_Util.html @@ -114,12 +114,12 @@ @@ -139,59 +139,37 @@
- + \
-
+
- + Query
-
+
- -
-
-
- + Driver
-
+
- + SQL
-
+
@@ -211,10 +189,10 @@
- + Util
-
+
@@ -249,8 +227,8 @@ @@ -297,7 +275,7 @@
- create_table()
+ create_table()
delete_table()
backup_structure()
backup_data()
@@ -420,7 +398,7 @@
-

create_table()

+

create_table()

create_table(string $name, array $fields, array $constraints, bool $if_not_exists) : string

Convenience public function to generate sql for creating a db table

@@ -457,11 +435,7 @@
diff --git a/docs/classes/Query.Driver.Util.MySQL_Util.html b/docs/classes/Query.Driver.Util.MySQL_Util.html index ec78d21..58fb295 100644 --- a/docs/classes/Query.Driver.Util.MySQL_Util.html +++ b/docs/classes/Query.Driver.Util.MySQL_Util.html @@ -114,12 +114,12 @@ @@ -139,59 +139,37 @@
- + \
-
+
- + Query
-
+
- -
-
-
- + Driver
-
+
- + SQL
-
+
@@ -211,10 +189,10 @@
- + Util
-
+
@@ -249,8 +227,8 @@ @@ -301,7 +279,7 @@ backup_data()
__construct()
get_driver()
- create_table()
+ create_table()
delete_table()
quote_ident()
quote_table()
@@ -568,7 +546,7 @@
-

create_table()

+

create_table()

create_table(string $name, array $fields, array $constraints, bool $if_not_exists) : string

Convenience public function to generate sql for creating a db table

@@ -605,11 +583,7 @@
+ + + + +
+ todo + +
+ +
+ +
+
+ +
+

VALUE

+
VALUE
+

+ +
+
+ +
+ +
+
+ +
+

BOTH

+
BOTH
+

+ +
+
+ +
+ +
@@ -449,96 +526,6 @@ instantiates the specific db driver

- - -
- -
- -
-
- -
-

$util

-
$util : \Query\Driver\Abstract_Util
-

Alias to driver util class

- - -

Type

- \Query\Driver\Abstract_Util -
-
- -
- -
-
- -
-

$sql

-
$sql : \Query\Driver\SQL_Interface
-

Alias to driver sql class

- - -

Type

- \Query\Driver\SQL_Interface -
-
- -
- -
-

$conn_name

@@ -601,22 +588,24 @@ instantiates the specific db driver

-
+
- +
+
+ +
+
+ +
+

$sql

+
$sql : \Query\Driver\SQL_Interface
+

Alias to driver sql class

+ + +

Type

+ \Query\Driver\SQL_Interface +
+
+ +
+ +
@@ -1117,7 +1170,99 @@ array(

- +
+
+ +
+

$parser

+
$parser : \Query\Query_Parser
+

Query parser class instance

+ + +

Type

+ \Query\Query_Parser +
+
+ +
+ +
+
+ +
+

$string_vars

+
$string_vars : array
+

String class values to be reset

+ + +

Type

+ array +
+
+ +
+ +
+
+ +
+

$array_vars

+
$array_vars : array
+

Array class variables to be reset

+ + +

Type

+ array +
+
+ +
+ +

Methods

@@ -1209,6 +1354,57 @@ array(

+ +
+

__call()

+ +
__call(string $name, array $params) : mixed
+

Calls a function further down the inheritence chain

+ + +

Parameters

+ + + + + + + + + + + +
string$name
array$params
+ +

Throws

+
+
\BadMethodCallException
+
+
+ +

Returns

+ mixed +
+
+ +
+ +
+

select()

@@ -1487,13 +1683,7 @@ array(

Tags

- - - - +
- todo - -
None found
@@ -2337,13 +2527,7 @@ passed array with key / value pairs

Tags

- - - - +
- todo - -
None found
@@ -3072,38 +3256,43 @@ in place of the get() method

-
+
- +
-

__call()

+

_mixed_set()

-
__call(string $name, array $params) : mixed
-

Calls a function further down the inheritence chain

+
_mixed_set(array $var, mixed $key, mixed $val, int $val_type) : array
+

Set values in the class, with either an array or key value pair

Parameters

- - + + - - + + + + + + + + + + + +
string$namearray$var
array$paramsmixed$key
mixed$val
int$val_type
-

Throws

-
-
\BadMethodCallException
-
-

Returns

- mixed + array
-
+
@@ -3811,7 +4000,7 @@ in place of the get() method


Documentation is powered by phpDocumentor and authored - on April 24th, 2014 at 17:07. + on August 8th, 2014 at 12:45.
diff --git a/docs/classes/Query.Query_Builder_Interface.html b/docs/classes/Query.Query_Builder_Interface.html index dcb5f7a..0f0305f 100644 --- a/docs/classes/Query.Query_Builder_Interface.html +++ b/docs/classes/Query.Query_Builder_Interface.html @@ -114,12 +114,12 @@ @@ -139,59 +139,37 @@
- + \
-
+
- + Query
-
+
- -
-
-
- + Driver
-
+
- + SQL
-
+
@@ -211,10 +189,10 @@
- + Util
-
+
@@ -249,8 +227,8 @@ @@ -2303,7 +2281,7 @@ in place of the get() method


Documentation is powered by phpDocumentor and authored - on April 24th, 2014 at 17:07. + on August 8th, 2014 at 12:45.
diff --git a/docs/classes/Query.Query_Parser.html b/docs/classes/Query.Query_Parser.html index 4478194..804ee4d 100644 --- a/docs/classes/Query.Query_Parser.html +++ b/docs/classes/Query.Query_Parser.html @@ -114,12 +114,12 @@ @@ -139,59 +139,37 @@
- + \
-
+
- + Query
-
+
- -
-
-
- + Driver
-
+
- + SQL
-
+
@@ -211,10 +189,10 @@
- + Util
-
+
@@ -249,8 +227,8 @@ @@ -682,7 +660,7 @@

Documentation is powered by phpDocumentor and authored - on April 24th, 2014 at 17:07. + on August 8th, 2014 at 12:45.
diff --git a/docs/files/autoload.php.html b/docs/files/autoload.php.html index 9166700..69dae0c 100644 --- a/docs/files/autoload.php.html +++ b/docs/files/autoload.php.html @@ -114,12 +114,12 @@ @@ -139,59 +139,37 @@
- + \
-
+
- + Query
-
+
- -
-
-
- + Driver
-
+
- + SQL
-
+
@@ -211,10 +189,10 @@
- + Util
-
+
-
-
-

Functions

-
- -
- -
-
- -
-

query_autoload()

- -
query_autoload(string $class)
-

Load query classes

- - -

Parameters

- - - - - - -
string$class
- - -
-
- -
- - +
@@ -522,7 +436,7 @@

Documentation is powered by phpDocumentor and authored - on April 24th, 2014 at 17:07. + on August 8th, 2014 at 12:45.
diff --git a/docs/files/autoload.php.txt b/docs/files/autoload.php.txt index 961c6b3..0a3065b 100644 --- a/docs/files/autoload.php.txt +++ b/docs/files/autoload.php.txt @@ -19,6 +19,8 @@ * @package Query */ +namespace Query; + /** * Reference to root path * @subpackage Core @@ -33,15 +35,10 @@ define('QDRIVER_PATH', QBASE_PATH.'drivers/'); // Require some common functions require(QBASE_PATH.'common.php'); +require(QBASE_PATH.'core/BadDBDriverException.php'); -/** - * Load query classes - * - * @subpackage Core - * @codeCoverageIgnore - * @param string $class - */ -function query_autoload($class) +// Load Query Classes +spl_autoload_register(function ($class) { $class_segments = explode('\\', $class); $class = strtolower(array_pop($class_segments)); @@ -52,30 +49,31 @@ function query_autoload($class) { // Firebird is a special case, since it's not a PDO driver + // @codeCoverageIgnoreStart if ( - in_array($class, PDO::getAvailableDrivers()) - || function_exists('fbird_connect') && $class === 'firebird' + in_array($class, \PDO::getAvailableDrivers()) + || function_exists('\\fbird_connect') && $class === 'firebird' ) { - array_map('do_include', glob("{$driver_path}/*.php")); + array_map('\\do_include', glob("{$driver_path}/*.php")); } + // @codeCoverageIgnoreEnd } // Load other classes foreach(array( - QBASE_PATH . "core/interfaces/{$class}.php", - QBASE_PATH . "core/abstract/{$class}.php", - QBASE_PATH . "core/{$class}.php" - ) as $path) + QBASE_PATH . "core/interfaces/{$class}.php", + QBASE_PATH . "core/abstract/{$class}.php", + QBASE_PATH . "core/{$class}.php" + ) as $path) { + // @codeCoverageIgnoreStart if (file_exists($path)) { require_once($path); } + // @codeCoverageIgnoreEnd } -} - -// Set up autoloader -spl_autoload_register('query_autoload'); +}); // End of autoload.php diff --git a/docs/files/common.php.html b/docs/files/common.php.html index b52c1b3..e2172a8 100644 --- a/docs/files/common.php.html +++ b/docs/files/common.php.html @@ -114,12 +114,12 @@ @@ -139,59 +139,37 @@
- + \
-
+
- + Query
-
+
- -
-
-
- + Driver
-
+
- + SQL
-
+
@@ -211,10 +189,10 @@
- + Util
-
+
@@ -249,8 +227,8 @@ @@ -694,7 +672,7 @@ connection created.


Documentation is powered by phpDocumentor and authored - on April 24th, 2014 at 17:07. + on August 8th, 2014 at 12:45.
diff --git a/docs/files/common.php.txt b/docs/files/common.php.txt index f99a491..a23c848 100644 --- a/docs/files/common.php.txt +++ b/docs/files/common.php.txt @@ -86,7 +86,7 @@ function from_camel_case($input) { preg_match_all('!([A-Z][A-Z0-9]*(?=$|[A-Z][a-z0-9])|[A-Za-z][a-z0-9]+)!', $input, $matches); $ret = $matches[0]; foreach ($ret as &$match) { - $match = $match == strtoupper($match) ? strtolower($match) : lcfirst($match); + $match = strtolower($match);// == strtoupper($match) ? strtolower($match) : lcfirst($match); } return implode('_', $ret); } @@ -145,10 +145,15 @@ function Query($params = '') } elseif ( ! is_scalar($params) && ! is_null($params)) { - $params = new ArrayObject($params, ArrayObject::STD_PROP_LIST | ArrayObject::ARRAY_AS_PROPS); + $params_object = new stdClass(); + + foreach($params as $k => $v) + { + $params_object->$k = $v; + } // Otherwise, return a new connection - return $cmanager->connect($params); + return $cmanager->connect($params_object); } // @codeCoverageIgnoreStart } diff --git a/docs/files/core.BadDBDriverException.php.html b/docs/files/core.BadDBDriverException.php.html new file mode 100644 index 0000000..e82e409 --- /dev/null +++ b/docs/files/core.BadDBDriverException.php.html @@ -0,0 +1,373 @@ + + + + + + Query + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+
+
+ + + +

coreBadDBDriverException.php

+

Query

+

Free Query Builder / Database Abstraction Layer

+ + + +

Classes

+ + + + + +
BadDBDriverExceptionGeneric exception for bad drivers
+
+ + +
+ + + +
+
+ + + + +
+ + + diff --git a/docs/files/core.abstract.abstract_driver.php.html b/docs/files/core.abstract.abstract_driver.php.html index 97036a8..c8b4071 100644 --- a/docs/files/core.abstract.abstract_driver.php.html +++ b/docs/files/core.abstract.abstract_driver.php.html @@ -114,12 +114,12 @@ @@ -139,59 +139,37 @@
- + \
-
+
- + Query
-
+
- -
-
-
- + Driver
-
+
- + SQL
-
+
@@ -211,10 +189,10 @@
- + Util
-
+
@@ -249,8 +227,8 @@ @@ -384,7 +362,7 @@

Documentation is powered by phpDocumentor and authored - on April 24th, 2014 at 17:07. + on August 8th, 2014 at 12:45.
diff --git a/docs/files/core.abstract.abstract_query_builder.php.html b/docs/files/core.abstract.abstract_query_builder.php.html index 6a4c05a..b1e8d1d 100644 --- a/docs/files/core.abstract.abstract_query_builder.php.html +++ b/docs/files/core.abstract.abstract_query_builder.php.html @@ -114,12 +114,12 @@ @@ -139,59 +139,37 @@
- + \
-
+
- + Query
-
+
- -
-
-
- + Driver
-
+
- + SQL
-
+
@@ -211,10 +189,10 @@
- + Util
-
+
@@ -249,8 +227,8 @@ @@ -384,7 +362,7 @@

Documentation is powered by phpDocumentor and authored - on April 24th, 2014 at 17:07. + on August 8th, 2014 at 12:45.
diff --git a/docs/files/core.abstract.abstract_sql.php.html b/docs/files/core.abstract.abstract_sql.php.html index 7f430f2..748b89c 100644 --- a/docs/files/core.abstract.abstract_sql.php.html +++ b/docs/files/core.abstract.abstract_sql.php.html @@ -114,12 +114,12 @@ @@ -139,59 +139,37 @@
- + \
-
+
- + Query
-
+
- -
-
-
- + Driver
-
+
- + SQL
-
+
@@ -211,10 +189,10 @@
- + Util
-
+
@@ -249,8 +227,8 @@ @@ -384,7 +362,7 @@

Documentation is powered by phpDocumentor and authored - on April 24th, 2014 at 17:07. + on August 8th, 2014 at 12:45.
diff --git a/docs/files/core.abstract.abstract_util.php.html b/docs/files/core.abstract.abstract_util.php.html index 57bd289..938e62a 100644 --- a/docs/files/core.abstract.abstract_util.php.html +++ b/docs/files/core.abstract.abstract_util.php.html @@ -114,12 +114,12 @@ @@ -139,59 +139,37 @@
- + \
-
+
- + Query
-
+
- -
-
-
- + Driver
-
+
- + SQL
-
+
@@ -211,10 +189,10 @@
- + Util
-
+
@@ -249,8 +227,8 @@ @@ -384,7 +362,7 @@

Documentation is powered by phpDocumentor and authored - on April 24th, 2014 at 17:07. + on August 8th, 2014 at 12:45.
diff --git a/docs/files/core.connection_manager.php.html b/docs/files/core.connection_manager.php.html index cf9fdea..88d618c 100644 --- a/docs/files/core.connection_manager.php.html +++ b/docs/files/core.connection_manager.php.html @@ -114,12 +114,12 @@ @@ -139,59 +139,37 @@
- + \
-
+
- + Query
-
+
- -
-
-
- + Driver
-
+
- + SQL
-
+
@@ -211,10 +189,10 @@
- + Util
-
+
@@ -249,8 +227,8 @@ @@ -286,10 +264,6 @@

Classes

- - - - @@ -389,7 +363,7 @@ Query method

Documentation is powered by phpDocumentor and authored - on April 24th, 2014 at 17:07. + on August 8th, 2014 at 12:45.
diff --git a/docs/files/core.interfaces.driver_interface.php.html b/docs/files/core.interfaces.driver_interface.php.html index 6c41a4d..3bc1842 100644 --- a/docs/files/core.interfaces.driver_interface.php.html +++ b/docs/files/core.interfaces.driver_interface.php.html @@ -114,12 +114,12 @@ @@ -139,59 +139,37 @@
- + \
-
+
- + Query
-
+
- -
-
-
- + Driver
-
+
- + SQL
-
+
@@ -211,10 +189,10 @@
- + Util
-
+
@@ -249,8 +227,8 @@ @@ -384,7 +362,7 @@

Documentation is powered by phpDocumentor and authored - on April 24th, 2014 at 17:07. + on August 8th, 2014 at 12:45.
diff --git a/docs/files/core.interfaces.query_builder_interface.php.html b/docs/files/core.interfaces.query_builder_interface.php.html index 347594b..1739e08 100644 --- a/docs/files/core.interfaces.query_builder_interface.php.html +++ b/docs/files/core.interfaces.query_builder_interface.php.html @@ -114,12 +114,12 @@ @@ -139,59 +139,37 @@
- + \
-
+
- + Query
-
+
- -
-
-
- + Driver
-
+
- + SQL
-
+
@@ -211,10 +189,10 @@
- + Util
-
+
@@ -249,8 +227,8 @@ @@ -384,7 +362,7 @@

Documentation is powered by phpDocumentor and authored - on April 24th, 2014 at 17:07. + on August 8th, 2014 at 12:45.
diff --git a/docs/files/core.interfaces.sql_interface.php.html b/docs/files/core.interfaces.sql_interface.php.html index a9f487a..af52ff1 100644 --- a/docs/files/core.interfaces.sql_interface.php.html +++ b/docs/files/core.interfaces.sql_interface.php.html @@ -114,12 +114,12 @@ @@ -139,59 +139,37 @@
- + \
-
+
- + Query
-
+
- -
-
-
- + Driver
-
+
- + SQL
-
+
@@ -211,10 +189,10 @@
- + Util
-
+
@@ -249,8 +227,8 @@ @@ -384,7 +362,7 @@

Documentation is powered by phpDocumentor and authored - on April 24th, 2014 at 17:07. + on August 8th, 2014 at 12:45.
diff --git a/docs/files/core.query_builder.php.html b/docs/files/core.query_builder.php.html index 332acad..4826908 100644 --- a/docs/files/core.query_builder.php.html +++ b/docs/files/core.query_builder.php.html @@ -114,12 +114,12 @@ @@ -139,59 +139,37 @@
- + \
-
+
- + Query
-
+
- -
-
-
- + Driver
-
+
- + SQL
-
+
@@ -211,10 +189,10 @@
- + Util
-
+
@@ -249,8 +227,8 @@ @@ -385,7 +363,7 @@ instantiates the specific db driver

Documentation is powered by phpDocumentor and authored - on April 24th, 2014 at 17:07. + on August 8th, 2014 at 12:45.
diff --git a/docs/files/core.query_parser.php.html b/docs/files/core.query_parser.php.html index d80a642..f7cd86d 100644 --- a/docs/files/core.query_parser.php.html +++ b/docs/files/core.query_parser.php.html @@ -114,12 +114,12 @@ @@ -139,59 +139,37 @@
- + \
-
+
- + Query
-
+
- -
-
-
- + Driver
-
+
- + SQL
-
+
@@ -211,10 +189,10 @@
- + Util
-
+
@@ -249,8 +227,8 @@ @@ -384,7 +362,7 @@

Documentation is powered by phpDocumentor and authored - on April 24th, 2014 at 17:07. + on August 8th, 2014 at 12:45.
diff --git a/docs/files/core/BadDBDriverException.php.txt b/docs/files/core/BadDBDriverException.php.txt new file mode 100644 index 0000000..c7c6c10 --- /dev/null +++ b/docs/files/core/BadDBDriverException.php.txt @@ -0,0 +1,26 @@ +sql = new $sql_class(); $this->util = new $util_class($this); - $this->table = new Table_Builder('', array(), $this); } // -------------------------------------------------------------------------- @@ -291,8 +288,7 @@ abstract class Abstract_Driver extends \PDO implements Driver_Interface { // Handle comma-separated identifiers if (strpos($ident, ',') !== FALSE) { - $parts = explode(',', $ident); - $parts = array_map('mb_trim', $parts); + $parts = array_map('mb_trim', explode(',', $ident)); $parts = array_map(array($this, __METHOD__), $parts); $ident = implode(',', $parts); } @@ -341,7 +337,9 @@ abstract class Abstract_Driver extends \PDO implements Driver_Interface { */ public function get_tables() { - return $this->driver_query('table_list'); + $tables = $this->driver_query('table_list'); + natsort($tables); + return $tables; } // ------------------------------------------------------------------------- @@ -365,7 +363,9 @@ abstract class Abstract_Driver extends \PDO implements Driver_Interface { */ public function get_views() { - return $this->driver_query('view_list'); + $views = $this->driver_query('view_list'); + sort($views); + return $views; } // ------------------------------------------------------------------------- @@ -584,10 +584,9 @@ abstract class Abstract_Driver extends \PDO implements Driver_Interface { // and is not already quoted before quoting // that value, otherwise, return the original value return ( - strpos($str, $this->escape_char) !== 0 + is_string($str) + && strpos($str, $this->escape_char) !== 0 && strrpos($str, $this->escape_char) !== 0 - && is_string($str) - && ! is_numeric($str) ) ? "{$this->escape_char}{$str}{$this->escape_char}" : $str; @@ -623,7 +622,6 @@ abstract class Abstract_Driver extends \PDO implements Driver_Interface { */ public function truncate($table) { - $sql = ($this->has_truncate) ? 'TRUNCATE ' : 'DELETE FROM '; diff --git a/docs/files/core/abstract/abstract_query_builder.php.txt b/docs/files/core/abstract/abstract_query_builder.php.txt index df92642..e897dac 100644 --- a/docs/files/core/abstract/abstract_query_builder.php.txt +++ b/docs/files/core/abstract/abstract_query_builder.php.txt @@ -22,7 +22,16 @@ use \Query\Driver\Driver_Interface; * Abstract Class for internal implementation methods of the Query Builder * @package Query */ -abstract class Abstract_Query_Builder implements Query_Builder_Interface { +abstract class Abstract_Query_Builder { + + // -------------------------------------------------------------------------- + // ! Constants + // -------------------------------------------------------------------------- + + const KEY = 0; + const VALUE = 1; + const BOTH = 2; + // -------------------------------------------------------------------------- // ! SQL Clause Strings @@ -147,36 +156,64 @@ abstract class Abstract_Query_Builder implements Query_Builder_Interface { */ protected $explain; + /** + * The current database driver + * @var Driver_Interface + */ + public $db; + + /** + * Query parser class instance + * @var Query_Parser + */ + protected $parser; + + /** + * Alias to driver util class + * @var \Query\Driver\Abstract_Util + */ + public $util; + + /** + * Alias to driver sql class + * @var \Query\Driver\SQL_Interface + */ + public $sql; + // -------------------------------------------------------------------------- // Methods // -------------------------------------------------------------------------- /** - * Calls a function further down the inheritence chain + * Set values in the class, with either an array or key value pair * - * @param string $name - * @param array $params - * @return mixed - * @throws \BadMethodCallException + * @param array $var + * @param mixed $key + * @param mixed $val + * @param int $val_type + * @return array */ - public function __call($name, $params) + protected function _mixed_set(&$var, $key, $val=NULL, $val_type=self::BOTH) { - // Allow camel-case method calls - $snake_name = \from_camel_case($name); + $arg = (is_scalar($key) && is_scalar($val)) + ? array($key => $val) + : $key; - foreach(array($this, $this->db) as $object) + foreach($arg as $k => $v) { - foreach(array($name, $snake_name) as $method_name) + if (in_array($val_type, array(self::KEY, self::VALUE))) { - if (method_exists($object, $method_name)) - { - return call_user_func_array(array($object, $method_name), $params); - } + $var[] = ($val_type === self::KEY) + ? $k + : $v; + } + else + { + $var[$k] = $v; } - } - throw new \BadMethodCallException("Method does not exist"); + return $var; } // -------------------------------------------------------------------------- @@ -215,10 +252,7 @@ abstract class Abstract_Query_Builder implements Query_Builder_Interface { $sql = $this->_compile($type, $table); // Reset the query builder for the next query - if ($reset) - { - $this->reset_query(); - } + if ($reset) $this->reset_query(); return $sql; } @@ -240,7 +274,7 @@ abstract class Abstract_Query_Builder implements Query_Builder_Interface { $field = $this->db->quote_ident($field); // Add the like string into the order map - $l = $field. " {$like} ?"; + $like = $field. " {$like} ?"; if ($pos == 'before') { @@ -256,7 +290,7 @@ abstract class Abstract_Query_Builder implements Query_Builder_Interface { } $conj = (empty($this->query_map)) ? ' WHERE ' : " {$conj} "; - $this->_append_map($conj, $l, 'like'); + $this->_append_map($conj, $like, 'like'); // Add to the values array $this->where_values[] = $val; @@ -312,23 +346,8 @@ abstract class Abstract_Query_Builder implements Query_Builder_Interface { protected function _where($key, $val=array()) { $where = array(); - - // Key and value passed? Add them to the where array - if (is_scalar($key) && is_scalar($val)) - { - $where[$key] = $val; - $this->where_values[] = $val; - } - // Array or object, loop through and add to the where array - elseif ( ! is_scalar($key)) - { - foreach($key as $k => $v) - { - $where[$k] = $v; - $this->where_values[] = $v; - } - } - + $this->_mixed_set($where, $key, $val, self::BOTH); + $this->_mixed_set($this->where_values, $key, $val, self::VALUE); return $where; } @@ -344,10 +363,8 @@ abstract class Abstract_Query_Builder implements Query_Builder_Interface { */ protected function _where_string($key, $val=array(), $conj='AND') { - $where = $this->_where($key, $val); - // Create key/value placeholders - foreach($where as $f => $val) + foreach($this->_where($key, $val) as $f => $val) { // Split each key by spaces, in case there // is an operator such as >, <, !=, etc. @@ -359,14 +376,15 @@ abstract class Abstract_Query_Builder implements Query_Builder_Interface { $item .= (count($f_array) === 1) ? '=?' : " {$f_array[1]} ?"; // Get the type of the first item in the query map - $first_item = end($this->query_map); + $first_item = current($this->query_map); + $last_item = end($this->query_map); // Determine the correct conjunction - if (empty($this->query_map)) + if (empty($this->query_map) || stripos($first_item['conjunction'], 'JOIN') !== FALSE) { $conj = "\nWHERE "; } - elseif ($first_item['type'] === 'group_start') + elseif ($last_item['type'] === 'group_start') { $conj = ''; } @@ -488,7 +506,7 @@ abstract class Abstract_Query_Builder implements Query_Builder_Interface { // Quote string values foreach($evals as &$v) { - $v = ( ! is_numeric($v)) ? htmlentities($this->db->quote($v), ENT_NOQUOTES, 'utf-8', FALSE) : $v; + $v = ( ! is_numeric($v)) ? htmlentities($this->db->quote($v), ENT_NOQUOTES, 'utf-8') : $v; } // Add the query onto the array of values to pass @@ -600,6 +618,8 @@ abstract class Abstract_Query_Builder implements Query_Builder_Interface { $sql = $this->sql->explain($sql); } +// $sql . "
"; + return $sql; } } diff --git a/docs/files/core/abstract/abstract_util.php.txt b/docs/files/core/abstract/abstract_util.php.txt index d10d08b..95f5364 100644 --- a/docs/files/core/abstract/abstract_util.php.txt +++ b/docs/files/core/abstract/abstract_util.php.txt @@ -60,7 +60,6 @@ abstract class Abstract_Util { /** * Convenience public function to generate sql for creating a db table * - * @deprecated Use the table builder class instead * @param string $name * @param array $fields * @param array $constraints diff --git a/docs/files/core/connection_manager.php.txt b/docs/files/core/connection_manager.php.txt index d6f0c0a..6ffb8a6 100644 --- a/docs/files/core/connection_manager.php.txt +++ b/docs/files/core/connection_manager.php.txt @@ -15,16 +15,6 @@ namespace Query; -/** - * Generic exception for bad drivers - * - * @package Query - * @subpackage Core - */ -class BadDBDriverException extends \InvalidArgumentException {} - -// -------------------------------------------------------------------------- - /** * Connection manager class to manage connections for the * Query method @@ -124,10 +114,10 @@ final class Connection_Manager { /** * Parse the passed parameters and return a connection * - * @param \ArrayObject $params + * @param \stdClass $params * @return Query_Builder */ - public function connect(\ArrayObject $params) + public function connect(\stdClass $params) { list($dsn, $dbtype, $params, $options) = $this->parse_params($params); @@ -166,11 +156,11 @@ final class Connection_Manager { /** * Parses params into a dsn and option array * - * @param \ArrayObject $params + * @param \stdClass $params * @return array * @throws BadDBDriverException */ - private function parse_params(\ArrayObject $params) + private function parse_params(\stdClass $params) { $params->type = strtolower($params->type); $dbtype = ($params->type !== 'postgresql') ? $params->type : 'pgsql'; @@ -201,10 +191,10 @@ final class Connection_Manager { * Create the dsn from the db type and params * * @param string $dbtype - * @param \ArrayObject $params + * @param \stdClass $params * @return string */ - private function create_dsn($dbtype, \ArrayObject $params) + private function create_dsn($dbtype, \stdClass $params) { if ($dbtype === 'firebird') $dsn = "{$params->host}:{$params->file}"; elseif ($dbtype === 'sqlite') $dsn = $params->file; @@ -225,7 +215,8 @@ final class Connection_Manager { 'type' => 'type', 'prefix' => 'prefix', 'options' => 'options', - 'database' => 'database' + 'database' => 'database', + 'alias' => 'alias' ); foreach($params as $key => $val) diff --git a/docs/files/core/query_builder.php.txt b/docs/files/core/query_builder.php.txt index 077bb08..dd28b27 100644 --- a/docs/files/core/query_builder.php.txt +++ b/docs/files/core/query_builder.php.txt @@ -14,7 +14,7 @@ // -------------------------------------------------------------------------- namespace Query; -use \Query\Driver\Driver_Interface; +use Query\Driver\Driver_Interface; // -------------------------------------------------------------------------- @@ -25,7 +25,130 @@ use \Query\Driver\Driver_Interface; * @package Query * @subpackage Query_Builder */ -class Query_Builder extends Abstract_Query_Builder { +class Query_Builder extends Abstract_Query_Builder implements Query_Builder_Interface { + + // -------------------------------------------------------------------------- + // ! SQL Clause Strings + // -------------------------------------------------------------------------- + + /** + * Compiled 'select' clause + * @var string + */ + protected $select_string = ''; + + /** + * Compiled 'from' clause + * @var string + */ + protected $from_string; + + /** + * Compiled arguments for insert / update + * @var string + */ + protected $set_string; + + /** + * Order by clause + * @var string + */ + protected $order_string; + + /** + * Group by clause + * @var string + */ + protected $group_string; + + // -------------------------------------------------------------------------- + // ! SQL Clause Arrays + // -------------------------------------------------------------------------- + + /** + * Keys for insert/update statement + * @var array + */ + protected $set_array_keys = array(); + + /** + * Key/val pairs for order by clause + * @var array + */ + protected $order_array = array(); + + /** + * Key/val pairs for group by clause + * @var array + */ + protected $group_array = array(); + + // -------------------------------------------------------------------------- + // ! Other Class vars + // -------------------------------------------------------------------------- + + /** + * Values to apply to prepared statements + * @var array + */ + protected $values = array(); + + /** + * Values to apply to where clauses in prepared statements + * @var array + */ + protected $where_values = array(); + + /** + * Value for limit string + * @var int + */ + protected $limit; + + /** + * Value for offset in limit string + * @var bool|int + */ + protected $offset; + + /** + * Query component order mapping + * for complex select queries + * + * Format: + * array( + * 'type' => 'where', + * 'conjunction' => ' AND ', + * 'string' => 'k=?' + * ) + * + * @var array + */ + protected $query_map = array(); + + /** + * Map for having clause + * @var array + */ + protected $having_map; + + /** + * Convenience property for connection management + * @var string + */ + public $conn_name = ""; + + /** + * List of queries executed + * @var array + */ + public $queries; + + /** + * Whether to do only an explain on the query + * @var bool + */ + protected $explain; /** * The current database driver @@ -51,6 +174,37 @@ class Query_Builder extends Abstract_Query_Builder { */ public $sql; + /** + * String class values to be reset + * + * @var array + */ + private $string_vars = array( + 'select_string', + 'from_string', + 'set_string', + 'order_string', + 'group_string', + 'limit', + 'offset', + 'explain', + ); + + /** + * Array class variables to be reset + * + * @var array + */ + private $array_vars = array( + 'set_array_keys', + 'order_array', + 'group_array', + 'values', + 'where_values', + 'query_map', + 'having_map' + ); + // -------------------------------------------------------------------------- // ! Methods // -------------------------------------------------------------------------- @@ -85,6 +239,36 @@ class Query_Builder extends Abstract_Query_Builder { $this->db = NULL; } + // -------------------------------------------------------------------------- + + /** + * Calls a function further down the inheritence chain + * + * @param string $name + * @param array $params + * @return mixed + * @throws \BadMethodCallException + */ + public function __call($name, $params) + { + // Allow camel-case method calls + $snake_name = \from_camel_case($name); + + foreach(array($this, $this->db) as $object) + { + foreach(array($name, $snake_name) as $method_name) + { + if (method_exists($object, $method_name)) + { + return call_user_func_array(array($object, $method_name), $params); + } + } + + } + + throw new \BadMethodCallException("Method does not exist"); + } + // -------------------------------------------------------------------------- // ! Select Queries // -------------------------------------------------------------------------- @@ -234,8 +418,8 @@ class Query_Builder extends Abstract_Query_Builder { public function from($tblname) { // Split identifiers on spaces - $ident_array = explode(' ', mb_trim($tblname)); - $ident_array = array_map('mb_trim', $ident_array); + $ident_array = explode(' ', \mb_trim($tblname)); + $ident_array = array_map('\\mb_trim', $ident_array); // Quote the identifiers $ident_array[0] = $this->db->quote_table($ident_array[0]); @@ -441,21 +625,8 @@ class Query_Builder extends Abstract_Query_Builder { */ public function set($key, $val = NULL) { - // Plain key, value pair - if (is_scalar($key) && is_scalar($val)) - { - $this->set_array_keys[] = $key; - $this->values[] = $val; - } - // Object or array - elseif (is_array($key) || is_object($key)) - { - foreach($key as $k => $v) - { - $this->set_array_keys[] = $k; - $this->values[] = $v; - } - } + $this->_mixed_set($this->set_array_keys, $key, $val, self::KEY); + $this->_mixed_set($this->values, $key, $val, self::VALUE); // Use the keys of the array to make the insert/update string // Escape the field names @@ -531,10 +702,12 @@ class Query_Builder extends Abstract_Query_Builder { */ public function order_by($field, $type="") { - // Random case + // When ordering by random, do an ascending order if the driver + // doesn't support random ordering if (stripos($type, 'rand') !== FALSE) { - $type = (($rand = $this->sql->random()) !== FALSE ) ? $rand : 'ASC'; + $rand = $this->sql->random(); + $type = ($rand !== FALSE) ? $rand : 'ASC'; } // Set fields for later manipulation @@ -550,7 +723,7 @@ class Query_Builder extends Abstract_Query_Builder { } // Set the final string - $this->order_string = (empty($rand)) + $this->order_string = ( ! isset($rand)) ? "\nORDER BY ".implode(', ', $order_clauses) : "\nORDER BY".$rand; @@ -568,7 +741,7 @@ class Query_Builder extends Abstract_Query_Builder { */ public function limit($limit, $offset=FALSE) { - $this->limit = $limit; + $this->limit = (int) $limit; $this->offset = $offset; return $this; @@ -652,16 +825,10 @@ class Query_Builder extends Abstract_Query_Builder { public function get($table='', $limit=FALSE, $offset=FALSE) { // Set the table - if ( ! empty($table)) - { - $this->from($table); - } + if ( ! empty($table)) $this->from($table); // Set the limit, if it exists - if (is_int($limit)) - { - $this->limit($limit, $offset); - } + if (is_int($limit)) $this->limit($limit, $offset); return $this->_run("get", $table); } @@ -713,14 +880,9 @@ class Query_Builder extends Abstract_Query_Builder { public function count_all_results($table='') { // Set the table - if ( ! empty($table)) - { - $this->from($table); - } + if ( ! empty($table)) $this->from($table); $result = $this->_run('get', $table); - - $rows = $result->fetchAll(); return (int) count($rows); @@ -738,10 +900,7 @@ class Query_Builder extends Abstract_Query_Builder { public function insert($table, $data=array()) { // No use duplicating logic! - if ( ! empty($data)) - { - $this->set($data); - } + if ( ! empty($data)) $this->set($data); return $this->_run("insert", $table); } @@ -777,10 +936,7 @@ class Query_Builder extends Abstract_Query_Builder { public function update($table, $data=array()) { // No use duplicating logic! - if ( ! empty($data)) - { - $this->set($data); - } + if ( ! empty($data)) $this->set($data); return $this->_run("update", $table); } @@ -797,10 +953,7 @@ class Query_Builder extends Abstract_Query_Builder { public function delete($table, $where='') { // Set the where clause - if ( ! empty($where)) - { - $this->where($where); - } + if ( ! empty($where)) $this->where($where); return $this->_run("delete", $table); } @@ -821,10 +974,7 @@ class Query_Builder extends Abstract_Query_Builder { public function get_compiled_select($table='', $reset=TRUE) { // Set the table - if ( ! empty($table)) - { - $this->from($table); - } + if ( ! empty($table)) $this->from($table); return $this->_get_compile('select', $table, $reset); } @@ -884,30 +1034,13 @@ class Query_Builder extends Abstract_Query_Builder { public function reset_query() { // Reset strings and booleans - foreach(array( - 'select_string', - 'from_string', - 'set_string', - 'order_string', - 'group_string', - 'limit', - 'offset', - 'explain', - ) as $var) + foreach($this->string_vars as $var) { $this->$var = NULL; } // Reset arrays - foreach(array( - 'set_array_keys', - 'order_array', - 'group_array', - 'values', - 'where_values', - 'query_map', - 'having_map' - ) as $var) + foreach($this->array_vars as $var) { $this->$var = array(); } diff --git a/docs/files/drivers.firebird.firebird_driver.php.html b/docs/files/drivers.firebird.firebird_driver.php.html index 480f928..6923915 100644 --- a/docs/files/drivers.firebird.firebird_driver.php.html +++ b/docs/files/drivers.firebird.firebird_driver.php.html @@ -114,12 +114,12 @@ @@ -139,59 +139,37 @@
- + \
-
+
- + Query
-
+
- -
-
-
- + Driver
-
+
- + SQL
-
+
@@ -211,10 +189,10 @@
- + Util
-
+
@@ -249,8 +227,8 @@ @@ -384,7 +362,7 @@

Documentation is powered by phpDocumentor and authored - on April 24th, 2014 at 17:07. + on August 8th, 2014 at 12:45.
diff --git a/docs/files/drivers.firebird.firebird_result.php.html b/docs/files/drivers.firebird.firebird_result.php.html index b519c83..5b779ae 100644 --- a/docs/files/drivers.firebird.firebird_result.php.html +++ b/docs/files/drivers.firebird.firebird_result.php.html @@ -114,12 +114,12 @@ @@ -139,59 +139,37 @@
- + \
-
+
- + Query
-
+
- -
-
-
- + Driver
-
+
- + SQL
-
+
@@ -211,10 +189,10 @@
- + Util
-
+
@@ -249,8 +227,8 @@ @@ -385,7 +363,7 @@ data-fetching methods

Documentation is powered by phpDocumentor and authored - on April 24th, 2014 at 17:07. + on August 8th, 2014 at 12:45.
diff --git a/docs/files/drivers.firebird.firebird_sql.php.html b/docs/files/drivers.firebird.firebird_sql.php.html index 0eebc94..132af6a 100644 --- a/docs/files/drivers.firebird.firebird_sql.php.html +++ b/docs/files/drivers.firebird.firebird_sql.php.html @@ -114,12 +114,12 @@ @@ -139,59 +139,37 @@
- + \
-
+
- + Query
-
+
- -
-
-
- + Driver
-
+
- + SQL
-
+
@@ -211,10 +189,10 @@
- + Util
-
+
@@ -249,8 +227,8 @@ @@ -384,7 +362,7 @@

Documentation is powered by phpDocumentor and authored - on April 24th, 2014 at 17:07. + on August 8th, 2014 at 12:45.
diff --git a/docs/files/drivers.firebird.firebird_util.php.html b/docs/files/drivers.firebird.firebird_util.php.html index 3fa616d..2a52673 100644 --- a/docs/files/drivers.firebird.firebird_util.php.html +++ b/docs/files/drivers.firebird.firebird_util.php.html @@ -114,12 +114,12 @@ @@ -139,59 +139,37 @@
- + \
-
+
- + Query
-
+
- -
-
-
- + Driver
-
+
- + SQL
-
+
@@ -211,10 +189,10 @@
- + Util
-
+
@@ -249,8 +227,8 @@ @@ -384,7 +362,7 @@

Documentation is powered by phpDocumentor and authored - on April 24th, 2014 at 17:07. + on August 8th, 2014 at 12:45.
diff --git a/docs/files/drivers.mysql.mysql_driver.php.html b/docs/files/drivers.mysql.mysql_driver.php.html index 4437c89..4596e44 100644 --- a/docs/files/drivers.mysql.mysql_driver.php.html +++ b/docs/files/drivers.mysql.mysql_driver.php.html @@ -114,12 +114,12 @@ @@ -139,59 +139,37 @@
- + \
-
+
- + Query
-
+
- -
-
-
- + Driver
-
+
- + SQL
-
+
@@ -211,10 +189,10 @@
- + Util
-
+
@@ -249,8 +227,8 @@ @@ -384,7 +362,7 @@

Documentation is powered by phpDocumentor and authored - on April 24th, 2014 at 17:07. + on August 8th, 2014 at 12:45.
diff --git a/docs/files/drivers.mysql.mysql_sql.php.html b/docs/files/drivers.mysql.mysql_sql.php.html index 1886f9d..a3095ff 100644 --- a/docs/files/drivers.mysql.mysql_sql.php.html +++ b/docs/files/drivers.mysql.mysql_sql.php.html @@ -114,12 +114,12 @@ @@ -139,59 +139,37 @@
- + \
-
+
- + Query
-
+
- -
-
-
- + Driver
-
+
- + SQL
-
+
@@ -211,10 +189,10 @@
- + Util
-
+
@@ -249,8 +227,8 @@ @@ -384,7 +362,7 @@

Documentation is powered by phpDocumentor and authored - on April 24th, 2014 at 17:07. + on August 8th, 2014 at 12:45.
diff --git a/docs/files/drivers.mysql.mysql_util.php.html b/docs/files/drivers.mysql.mysql_util.php.html index 8d9e4bb..73fd9c8 100644 --- a/docs/files/drivers.mysql.mysql_util.php.html +++ b/docs/files/drivers.mysql.mysql_util.php.html @@ -114,12 +114,12 @@ @@ -139,59 +139,37 @@
- + \
-
+
- + Query
-
+
- -
-
-
- + Driver
-
+
- + SQL
-
+
@@ -211,10 +189,10 @@
- + Util
-
+
@@ -249,8 +227,8 @@ @@ -384,7 +362,7 @@

Documentation is powered by phpDocumentor and authored - on April 24th, 2014 at 17:07. + on August 8th, 2014 at 12:45.
diff --git a/docs/files/drivers.pgsql.pgsql_driver.php.html b/docs/files/drivers.pgsql.pgsql_driver.php.html index 8ed0c2b..69cbb52 100644 --- a/docs/files/drivers.pgsql.pgsql_driver.php.html +++ b/docs/files/drivers.pgsql.pgsql_driver.php.html @@ -114,12 +114,12 @@ @@ -139,59 +139,37 @@
- + \
-
+
- + Query
-
+
- -
-
-
- + Driver
-
+
- + SQL
-
+
@@ -211,10 +189,10 @@
- + Util
-
+
@@ -249,8 +227,8 @@ @@ -384,7 +362,7 @@

Documentation is powered by phpDocumentor and authored - on April 24th, 2014 at 17:07. + on August 8th, 2014 at 12:45.
diff --git a/docs/files/drivers.pgsql.pgsql_sql.php.html b/docs/files/drivers.pgsql.pgsql_sql.php.html index aed0b85..5027aeb 100644 --- a/docs/files/drivers.pgsql.pgsql_sql.php.html +++ b/docs/files/drivers.pgsql.pgsql_sql.php.html @@ -114,12 +114,12 @@ @@ -139,59 +139,37 @@
- + \
-
+
- + Query
-
+
- -
-
-
- + Driver
-
+
- + SQL
-
+
@@ -211,10 +189,10 @@
- + Util
-
+
@@ -249,8 +227,8 @@ @@ -384,7 +362,7 @@

Documentation is powered by phpDocumentor and authored - on April 24th, 2014 at 17:07. + on August 8th, 2014 at 12:45.
diff --git a/docs/files/drivers.pgsql.pgsql_util.php.html b/docs/files/drivers.pgsql.pgsql_util.php.html index ce08ba8..cbf628a 100644 --- a/docs/files/drivers.pgsql.pgsql_util.php.html +++ b/docs/files/drivers.pgsql.pgsql_util.php.html @@ -114,12 +114,12 @@ @@ -139,59 +139,37 @@
- + \
-
+
- + Query
-
+
- -
-
-
- + Driver
-
+
- + SQL
-
+
@@ -211,10 +189,10 @@
- + Util
-
+
@@ -249,8 +227,8 @@ @@ -384,7 +362,7 @@

Documentation is powered by phpDocumentor and authored - on April 24th, 2014 at 17:07. + on August 8th, 2014 at 12:45.
diff --git a/docs/files/drivers.sqlite.sqlite_driver.php.html b/docs/files/drivers.sqlite.sqlite_driver.php.html index 732b5ed..9a8efb9 100644 --- a/docs/files/drivers.sqlite.sqlite_driver.php.html +++ b/docs/files/drivers.sqlite.sqlite_driver.php.html @@ -114,12 +114,12 @@ @@ -139,59 +139,37 @@
- + \
-
+
- + Query
-
+
- -
-
-
- + Driver
-
+
- + SQL
-
+
@@ -211,10 +189,10 @@
- + Util
-
+
@@ -249,8 +227,8 @@ @@ -384,7 +362,7 @@

Documentation is powered by phpDocumentor and authored - on April 24th, 2014 at 17:07. + on August 8th, 2014 at 12:45.
diff --git a/docs/files/drivers.sqlite.sqlite_sql.php.html b/docs/files/drivers.sqlite.sqlite_sql.php.html index 00bce8f..9c6b118 100644 --- a/docs/files/drivers.sqlite.sqlite_sql.php.html +++ b/docs/files/drivers.sqlite.sqlite_sql.php.html @@ -114,12 +114,12 @@ @@ -139,59 +139,37 @@
- + \
-
+
- + Query
-
+
- -
-
-
- + Driver
-
+
- + SQL
-
+
@@ -211,10 +189,10 @@
- + Util
-
+
@@ -249,8 +227,8 @@ @@ -384,7 +362,7 @@

Documentation is powered by phpDocumentor and authored - on April 24th, 2014 at 17:07. + on August 8th, 2014 at 12:45.
diff --git a/docs/files/drivers.sqlite.sqlite_util.php.html b/docs/files/drivers.sqlite.sqlite_util.php.html index 2d58e8b..3110754 100644 --- a/docs/files/drivers.sqlite.sqlite_util.php.html +++ b/docs/files/drivers.sqlite.sqlite_util.php.html @@ -114,12 +114,12 @@ @@ -139,59 +139,37 @@
- + \
-
+
- + Query
-
+
- -
-
-
- + Driver
-
+
- + SQL
-
+
@@ -211,10 +189,10 @@
- + Util
-
+
@@ -249,8 +227,8 @@ @@ -384,7 +362,7 @@

Documentation is powered by phpDocumentor and authored - on April 24th, 2014 at 17:07. + on August 8th, 2014 at 12:45.
diff --git a/docs/files/drivers/firebird/firebird_driver.php.txt b/docs/files/drivers/firebird/firebird_driver.php.txt index 2890580..efa6ada 100644 --- a/docs/files/drivers/firebird/firebird_driver.php.txt +++ b/docs/files/drivers/firebird/firebird_driver.php.txt @@ -392,7 +392,7 @@ class Firebird extends Abstract_Driver { // End the block of SQL statements $sql .= "END"; - // Ruturn a null array value so the query is run as it is, + // Return a null array value so the query is run as it is, // not as a prepared statement, because a prepared statement // doesn't work for this type of query in Firebird. return array($sql, NULL); diff --git a/docs/files/drivers/firebird/firebird_sql.php.txt b/docs/files/drivers/firebird/firebird_sql.php.txt index ad040e8..37e5a9b 100644 --- a/docs/files/drivers/firebird/firebird_sql.php.txt +++ b/docs/files/drivers/firebird/firebird_sql.php.txt @@ -131,7 +131,7 @@ SQL; public function view_list() { return <<sql->table_list(); - $res = $this->query($sql); return db_filter($res->fetchAll(\PDO::FETCH_ASSOC), 'name'); } diff --git a/docs/graphs/class.html b/docs/graphs/class.html index 0bf0a82..346e413 100644 --- a/docs/graphs/class.html +++ b/docs/graphs/class.html @@ -91,12 +91,12 @@ @@ -156,7 +156,7 @@

Documentation is powered by phpDocumentor and authored - on April 24th, 2014 at 17:07. + on August 8th, 2014 at 12:45.
diff --git a/docs/graphs/classes.svg b/docs/graphs/classes.svg index d5b3d1f..0ef1598 100644 --- a/docs/graphs/classes.svg +++ b/docs/graphs/classes.svg @@ -4,351 +4,299 @@ - - + + G - + cluster_Global - - - - - - - + + + + + + + -\ +\ cluster_\Query - - - - - - - + + + + + + + -Query +Query -cluster_\Query\Table - - - - - - - - -Table +cluster_\Query\Driver + + + + + + + + +Driver -cluster_\Query\Driver - - - - - - - - -Driver +cluster_\Query\Driver\SQL + + + + + + + + +SQL -cluster_\Query\Driver\SQL - - - - - - - - -SQL - -cluster_\Query\Driver\Util - - - - - - - - -Util - - -\\Query\\Table\\Abstract_Table - -«abstract» -Abstract_Table - - -\\Query\\Table\\Table_Builder - -Table_Builder - - -\\Query\\Table\\Table_Foreign_Key - -Table_Foreign_Key - - -\\Query\\Table\\Table_Foreign_Key->\\Query\\Table\\Abstract_Table - - - - -\\Query\\Table\\Table_Column - -Table_Column - - -\\Query\\Table\\Table_Column->\\Query\\Table\\Abstract_Table - - - - -\\Query\\Table\\Table_Index - -Table_Index - - -\\Query\\Table\\Table_Index->\\Query\\Table\\Abstract_Table - - +cluster_\Query\Driver\Util + + + + + + + + +Util -\\Query\\Driver\\SQL\\Abstract_SQL - -«abstract» -Abstract_SQL +\\Query\\Driver\\SQL\\Abstract_SQL + +«abstract» +Abstract_SQL -\\Query\\Driver\\SQL\\SQL_Interface - -SQL_Interface +\\Query\\Driver\\SQL\\SQL_Interface + +SQL_Interface -\\Query\\Driver\\SQL\\Abstract_SQL->\\Query\\Driver\\SQL\\SQL_Interface - - +\\Query\\Driver\\SQL\\Abstract_SQL->\\Query\\Driver\\SQL\\SQL_Interface + + -\\Query\\Driver\\SQL\\PgSQL_SQL - -PgSQL_SQL +\\Query\\Driver\\SQL\\PgSQL_SQL + +PgSQL_SQL -\\Query\\Driver\\SQL\\PgSQL_SQL->\\Query\\Driver\\SQL\\Abstract_SQL - - +\\Query\\Driver\\SQL\\PgSQL_SQL->\\Query\\Driver\\SQL\\Abstract_SQL + + -\\Query\\Driver\\SQL\\MySQL_SQL - -MySQL_SQL +\\Query\\Driver\\SQL\\MySQL_SQL + +MySQL_SQL -\\Query\\Driver\\SQL\\MySQL_SQL->\\Query\\Driver\\SQL\\Abstract_SQL - - +\\Query\\Driver\\SQL\\MySQL_SQL->\\Query\\Driver\\SQL\\Abstract_SQL + + -\\Query\\Driver\\SQL\\Firebird_SQL - -Firebird_SQL +\\Query\\Driver\\SQL\\Firebird_SQL + +Firebird_SQL -\\Query\\Driver\\SQL\\Firebird_SQL->\\Query\\Driver\\SQL\\Abstract_SQL - - +\\Query\\Driver\\SQL\\Firebird_SQL->\\Query\\Driver\\SQL\\Abstract_SQL + + -\\Query\\Driver\\SQL\\SQLite_SQL - -SQLite_SQL +\\Query\\Driver\\SQL\\SQLite_SQL + +SQLite_SQL -\\Query\\Driver\\SQL\\SQLite_SQL->\\Query\\Driver\\SQL\\Abstract_SQL - - +\\Query\\Driver\\SQL\\SQLite_SQL->\\Query\\Driver\\SQL\\Abstract_SQL + + -\\Query\\Driver\\Util\\Firebird_Util - -Firebird_Util +\\Query\\Driver\\Util\\Firebird_Util + +Firebird_Util -\\Query\\Driver\\Util\\Abstract_Util - -«abstract» -Abstract_Util +\\Query\\Driver\\Util\\Abstract_Util + +«abstract» +Abstract_Util -\\Query\\Driver\\Util\\Firebird_Util->\\Query\\Driver\\Util\\Abstract_Util - - +\\Query\\Driver\\Util\\Firebird_Util->\\Query\\Driver\\Util\\Abstract_Util + + -\\Query\\Driver\\Util\\MySQL_Util - -MySQL_Util +\\Query\\Driver\\Util\\MySQL_Util + +MySQL_Util -\\Query\\Driver\\Util\\MySQL_Util->\\Query\\Driver\\Util\\Abstract_Util - - +\\Query\\Driver\\Util\\MySQL_Util->\\Query\\Driver\\Util\\Abstract_Util + + -\\Query\\Driver\\Util\\SQLite_Util - -SQLite_Util +\\Query\\Driver\\Util\\SQLite_Util + +SQLite_Util -\\Query\\Driver\\Util\\SQLite_Util->\\Query\\Driver\\Util\\Abstract_Util - - +\\Query\\Driver\\Util\\SQLite_Util->\\Query\\Driver\\Util\\Abstract_Util + + -\\Query\\Driver\\Util\\PgSQL_Util - -PgSQL_Util +\\Query\\Driver\\Util\\PgSQL_Util + +PgSQL_Util -\\Query\\Driver\\Util\\PgSQL_Util->\\Query\\Driver\\Util\\Abstract_Util - - +\\Query\\Driver\\Util\\PgSQL_Util->\\Query\\Driver\\Util\\Abstract_Util + + -\\Query\\Driver\\Firebird_Result - -Firebird_Result +\\Query\\Driver\\Firebird_Result + +Firebird_Result -\\PDOStatement - -\PDOStatement +\\PDOStatement + +\PDOStatement -\\Query\\Driver\\Firebird_Result->\\PDOStatement - - +\\Query\\Driver\\Firebird_Result->\\PDOStatement + + -\\Query\\Driver\\Firebird - -Firebird +\\Query\\Driver\\Firebird + +Firebird -\\Query\\Driver\\Abstract_Driver - -«abstract» -Abstract_Driver +\\Query\\Driver\\Abstract_Driver + +«abstract» +Abstract_Driver -\\Query\\Driver\\Firebird->\\Query\\Driver\\Abstract_Driver - - +\\Query\\Driver\\Firebird->\\Query\\Driver\\Abstract_Driver + + -\\Query\\Driver\\Driver_Interface - -Driver_Interface +\\Query\\Driver\\Driver_Interface + +Driver_Interface -\\Query\\Driver\\Abstract_Driver->\\Query\\Driver\\Driver_Interface - - +\\Query\\Driver\\Abstract_Driver->\\Query\\Driver\\Driver_Interface + + -\\PDO - -\PDO +\\PDO + +\PDO -\\Query\\Driver\\Abstract_Driver->\\PDO - - +\\Query\\Driver\\Abstract_Driver->\\PDO + + -\\Query\\Driver\\SQLite - -SQLite +\\Query\\Driver\\SQLite + +SQLite -\\Query\\Driver\\SQLite->\\Query\\Driver\\Abstract_Driver - - +\\Query\\Driver\\SQLite->\\Query\\Driver\\Abstract_Driver + + -\\Query\\Driver\\PgSQL - -PgSQL +\\Query\\Driver\\PgSQL + +PgSQL -\\Query\\Driver\\PgSQL->\\Query\\Driver\\Abstract_Driver - - +\\Query\\Driver\\PgSQL->\\Query\\Driver\\Abstract_Driver + + -\\Query\\Driver\\MySQL - -MySQL +\\Query\\Driver\\MySQL + +MySQL -\\Query\\Driver\\MySQL->\\Query\\Driver\\Abstract_Driver - - +\\Query\\Driver\\MySQL->\\Query\\Driver\\Abstract_Driver + + -\\Query\\Query_Parser - -Query_Parser - - -\\Query\\Query_Builder - -Query_Builder - - -\\Query\\Abstract_Query_Builder - -«abstract» -Abstract_Query_Builder - - -\\Query\\Query_Builder->\\Query\\Abstract_Query_Builder - - +\\Query\\Query_Parser + +Query_Parser -\\Query\\BadDBDriverException - -BadDBDriverException +\\Query\\BadDBDriverException + +BadDBDriverException -\\InvalidArgumentException - -\InvalidArgumentException +\\InvalidArgumentException + +\InvalidArgumentException -\\Query\\BadDBDriverException->\\InvalidArgumentException - - +\\Query\\BadDBDriverException->\\InvalidArgumentException + + - -\\Query\\Connection_Manager - -Connection_Manager + +\\Query\\Query_Builder + +Query_Builder + + +\\Query\\Abstract_Query_Builder + +«abstract» +Abstract_Query_Builder + + +\\Query\\Query_Builder->\\Query\\Abstract_Query_Builder + + -\\Query\\Query_Builder_Interface - -Query_Builder_Interface +\\Query\\Query_Builder_Interface + +Query_Builder_Interface - -\\Query\\Abstract_Query_Builder->\\Query\\Query_Builder_Interface - - + +\\Query\\Query_Builder->\\Query\\Query_Builder_Interface + + + + +\\Query\\Connection_Manager + +Connection_Manager diff --git a/docs/namespaces/Query.Driver.SQL.html b/docs/namespaces/Query.Driver.SQL.html index dc7932a..f7b29a7 100644 --- a/docs/namespaces/Query.Driver.SQL.html +++ b/docs/namespaces/Query.Driver.SQL.html @@ -66,12 +66,12 @@ @@ -91,59 +91,37 @@
- + \
-
+
- + Query
-
+
- -
-
-
- + Driver
-
+
- + SQL
-
+
@@ -163,10 +141,10 @@
- + Util
-
+
@@ -201,8 +179,8 @@ @@ -323,7 +301,7 @@

Documentation is powered by phpDocumentor and authored - on April 24th, 2014 at 17:07. + on August 8th, 2014 at 12:45.
diff --git a/docs/namespaces/Query.Driver.Util.html b/docs/namespaces/Query.Driver.Util.html index 877ca92..917d2a4 100644 --- a/docs/namespaces/Query.Driver.Util.html +++ b/docs/namespaces/Query.Driver.Util.html @@ -66,12 +66,12 @@ @@ -91,59 +91,37 @@
- + \
-
+
- + Query
-
+
- -
-
-
- + Driver
-
+
- + SQL
-
+
@@ -163,10 +141,10 @@
- + Util
-
+
@@ -201,8 +179,8 @@ @@ -316,7 +294,7 @@

Documentation is powered by phpDocumentor and authored - on April 24th, 2014 at 17:07. + on August 8th, 2014 at 12:45.
diff --git a/docs/namespaces/Query.Driver.html b/docs/namespaces/Query.Driver.html index 27176f6..ff81e1d 100644 --- a/docs/namespaces/Query.Driver.html +++ b/docs/namespaces/Query.Driver.html @@ -66,12 +66,12 @@ @@ -91,59 +91,37 @@
- + \
-
+
- + Query
-
+
- -
-
-
- + Driver
-
+
- + SQL
-
+
@@ -163,10 +141,10 @@
- + Util
-
+
@@ -201,8 +179,8 @@ @@ -335,7 +313,7 @@ data-fetching methods

Documentation is powered by phpDocumentor and authored - on April 24th, 2014 at 17:07. + on August 8th, 2014 at 12:45.
diff --git a/docs/namespaces/Query.html b/docs/namespaces/Query.html index 2b0fbc2..c76f412 100644 --- a/docs/namespaces/Query.html +++ b/docs/namespaces/Query.html @@ -66,12 +66,12 @@ @@ -91,59 +91,37 @@
- + \
-
+
- + Query
-
+
- -
-
-
- + Driver
-
+
- + SQL
-
+
@@ -163,10 +141,10 @@
BadDBDriverExceptionGeneric exception for bad drivers
Connection_Manager Connection manager class to manage connections for the Query method
- - -
Table
Driver
@@ -254,15 +229,15 @@ Query_Parser Utility Class to parse sql clauses for properly escaping identifiers + + + BadDBDriverException + Generic exception for bad drivers Query_Builder Convenience class for creating sql queries - also the class that instantiates the specific db driver - - - BadDBDriverException - Generic exception for bad drivers Connection_Manager @@ -330,7 +305,7 @@ Query method

Documentation is powered by phpDocumentor and authored - on April 24th, 2014 at 17:07. + on August 8th, 2014 at 12:45.
diff --git a/docs/namespaces/default.html b/docs/namespaces/default.html index 1b29518..7239e1a 100644 --- a/docs/namespaces/default.html +++ b/docs/namespaces/default.html @@ -66,12 +66,12 @@ @@ -91,59 +91,37 @@
- + \
-
+
- + Query
-
+
- -
-
-
- + Driver
-
+
- + SQL
-
+
@@ -163,10 +141,10 @@
- + Util
-
+
-
-
- -
-

query_autoload()

- -
query_autoload(string $class)
-

Load query classes

- - -

Parameters

- - - - - - -
string$class
- - -
-
- -
-
@@ -748,7 +669,7 @@ connection created.


Documentation is powered by phpDocumentor and authored - on April 24th, 2014 at 17:07. + on August 8th, 2014 at 12:45.
diff --git a/docs/reports/deprecated.html b/docs/reports/deprecated.html index 2bcd4d2..9cbf825 100644 --- a/docs/reports/deprecated.html +++ b/docs/reports/deprecated.html @@ -67,12 +67,12 @@ @@ -107,25 +107,6 @@ 1 -
- - - - - - - - - - - -
TypeLineDescription
deprecatedUse the table builder class instead
-
- -

- - 1 -

@@ -181,7 +162,7 @@

Documentation is powered by phpDocumentor and authored - on April 24th, 2014 at 17:07. + on August 8th, 2014 at 12:45.
diff --git a/docs/reports/errors.html b/docs/reports/errors.html index 5b6ad95..a219d6c 100644 --- a/docs/reports/errors.html +++ b/docs/reports/errors.html @@ -67,12 +67,12 @@ @@ -92,7 +92,7 @@ +
@@ -155,14 +155,6 @@
-
-
-
-
-
-
-
-
@@ -203,7 +195,7 @@

Documentation is powered by phpDocumentor and authored - on April 24th, 2014 at 17:07. + on August 8th, 2014 at 12:45.
diff --git a/docs/reports/markers.html b/docs/reports/markers.html index 8257687..2ce71ca 100644 --- a/docs/reports/markers.html +++ b/docs/reports/markers.html @@ -67,12 +67,12 @@ @@ -91,8 +91,8 @@
@@ -104,7 +104,7 @@
-
+

@@ -126,7 +126,7 @@

-
+
@@ -167,7 +167,7 @@

Documentation is powered by phpDocumentor and authored - on April 24th, 2014 at 17:07. + on August 8th, 2014 at 12:45.