diff --git a/classes/query_builder.php b/classes/query_builder.php index bbb66ea..2f7ea75 100644 --- a/classes/query_builder.php +++ b/classes/query_builder.php @@ -4,10 +4,11 @@ * * Free Query Builder / Database Abstraction Layer * - * @author Timothy J. Warren + * @package Query + * @author Timothy J. Warren * @copyright Copyright (c) 2012 * @link https://github.com/aviat4ion/Query - * @license http://philsturgeon.co.uk/code/dbad-license + * @license http://philsturgeon.co.uk/code/dbad-license */ // -------------------------------------------------------------------------- @@ -23,26 +24,36 @@ class Query_Builder { /** * Compiled 'select' clause + * + * @var string */ private $select_string; /** * Compiled 'from' clause + * + * @var string */ private $from_string; /** * Compiled arguments for insert / update + * + * @var string */ private $set_string; /** * Order by clause + * + * @var string */ private $order_string; /** * Group by clause + * + * @var string */ private $group_string; @@ -50,21 +61,29 @@ class Query_Builder { /** * key/val pairs for insert/update statement + * + * @var array */ private $set_array; /** * Keys for insert/update statement + * + * @var array */ private $set_array_keys; /** * Key/val pairs for order by clause + * + * @var array */ private $order_array; /** * Key/val pairs for group by clause + * + * @var array */ private $group_array; @@ -72,21 +91,29 @@ class Query_Builder { /** * Values to apply to prepared statements + * + * @var array */ private $values; /** * Value for limit string + * + * @var int */ private $limit; /** * Value for offset in limit string + * + * @var int */ private $offset; /** * Alias to $this->db->sql + * + * @var DB_PDO */ private $sql; @@ -101,16 +128,22 @@ class Query_Builder { * 'conjunction' => ' AND ', * 'string' => 'k=?' * ) + * + * @var array */ private $query_map; /** * Map for having clause + * + * @var array */ private $having_map; /** - * Convenience property for connection management + * Convenience property for connection management + * + * @var string */ public $conn_name = ""; diff --git a/docs/classes/DB_PDO.html b/docs/classes/DB_PDO.html index 23dfdd0..44432cc 100644 --- a/docs/classes/DB_PDO.html +++ b/docs/classes/DB_PDO.html @@ -662,7 +662,7 @@ the connection/database
+ generated on 2012-04-23T13:28:33-04:00.
diff --git a/docs/classes/DB_Reg.html b/docs/classes/DB_Reg.html index 6b77ce0..c8b554c 100644 --- a/docs/classes/DB_Reg.html +++ b/docs/classes/DB_Reg.html @@ -151,7 +151,7 @@ and organizes database connections

+ generated on 2012-04-23T13:28:33-04:00.
diff --git a/docs/classes/DB_SQL.html b/docs/classes/DB_SQL.html index 5be1053..decec5a 100644 --- a/docs/classes/DB_SQL.html +++ b/docs/classes/DB_SQL.html @@ -268,7 +268,7 @@
+ generated on 2012-04-23T13:28:33-04:00.
diff --git a/docs/classes/DB_Util.html b/docs/classes/DB_Util.html index 067005b..c92305e 100644 --- a/docs/classes/DB_Util.html +++ b/docs/classes/DB_Util.html @@ -208,7 +208,7 @@
+ generated on 2012-04-23T13:28:33-04:00.
diff --git a/docs/classes/Firebird.html b/docs/classes/Firebird.html index 55a6b6f..0c28ed5 100644 --- a/docs/classes/Firebird.html +++ b/docs/classes/Firebird.html @@ -812,7 +812,7 @@ the last query executed
+ generated on 2012-04-23T13:28:33-04:00.
diff --git a/docs/classes/Firebird_Result.html b/docs/classes/Firebird_Result.html index 923e48b..a67d3f3 100644 --- a/docs/classes/Firebird_Result.html +++ b/docs/classes/Firebird_Result.html @@ -503,7 +503,7 @@ the query
+ generated on 2012-04-23T13:28:33-04:00.
diff --git a/docs/classes/Firebird_SQL.html b/docs/classes/Firebird_SQL.html index 525e8b7..a467f54 100644 --- a/docs/classes/Firebird_SQL.html +++ b/docs/classes/Firebird_SQL.html @@ -296,7 +296,7 @@
+ generated on 2012-04-23T13:28:33-04:00.
diff --git a/docs/classes/Firebird_Util.html b/docs/classes/Firebird_Util.html index 3b19fe7..63e5eb2 100644 --- a/docs/classes/Firebird_Util.html +++ b/docs/classes/Firebird_Util.html @@ -211,7 +211,7 @@
+ generated on 2012-04-23T13:28:33-04:00.
diff --git a/docs/classes/MySQL.html b/docs/classes/MySQL.html index ab4e967..9ea7684 100644 --- a/docs/classes/MySQL.html +++ b/docs/classes/MySQL.html @@ -848,7 +848,7 @@ the connection/database
+ generated on 2012-04-23T13:28:33-04:00.
diff --git a/docs/classes/MySQL_SQL.html b/docs/classes/MySQL_SQL.html index 9751588..79331ba 100644 --- a/docs/classes/MySQL_SQL.html +++ b/docs/classes/MySQL_SQL.html @@ -280,7 +280,7 @@
+ generated on 2012-04-23T13:28:33-04:00.
diff --git a/docs/classes/MySQL_Util.html b/docs/classes/MySQL_Util.html index d0db5c1..fd1e331 100644 --- a/docs/classes/MySQL_Util.html +++ b/docs/classes/MySQL_Util.html @@ -207,7 +207,7 @@
+ generated on 2012-04-23T13:28:33-04:00.
diff --git a/docs/classes/ODBC.html b/docs/classes/ODBC.html index 4a83a03..5543c04 100644 --- a/docs/classes/ODBC.html +++ b/docs/classes/ODBC.html @@ -850,7 +850,7 @@ the connection/database
+ generated on 2012-04-23T13:28:33-04:00.
diff --git a/docs/classes/ODBC_SQL.html b/docs/classes/ODBC_SQL.html index 6d274f6..41c6468 100644 --- a/docs/classes/ODBC_SQL.html +++ b/docs/classes/ODBC_SQL.html @@ -280,7 +280,7 @@
+ generated on 2012-04-23T13:28:33-04:00.
diff --git a/docs/classes/ODBC_Util.html b/docs/classes/ODBC_Util.html index bff92d2..1a343b7 100644 --- a/docs/classes/ODBC_Util.html +++ b/docs/classes/ODBC_Util.html @@ -202,7 +202,7 @@
+ generated on 2012-04-23T13:28:33-04:00.
diff --git a/docs/classes/PgSQL.html b/docs/classes/PgSQL.html index e25415f..c070a44 100644 --- a/docs/classes/PgSQL.html +++ b/docs/classes/PgSQL.html @@ -850,7 +850,7 @@ the connection/database
+ generated on 2012-04-23T13:28:33-04:00.
diff --git a/docs/classes/PgSQL_SQL.html b/docs/classes/PgSQL_SQL.html index b2648a0..26b7c6c 100644 --- a/docs/classes/PgSQL_SQL.html +++ b/docs/classes/PgSQL_SQL.html @@ -296,7 +296,7 @@
+ generated on 2012-04-23T13:28:33-04:00.
diff --git a/docs/classes/PgSQL_Util.html b/docs/classes/PgSQL_Util.html index ecba724..3cb3927 100644 --- a/docs/classes/PgSQL_Util.html +++ b/docs/classes/PgSQL_Util.html @@ -207,7 +207,7 @@
+ generated on 2012-04-23T13:28:33-04:00.
diff --git a/docs/classes/Query_Builder.html b/docs/classes/Query_Builder.html index 2943d59..214f3b9 100644 --- a/docs/classes/Query_Builder.html +++ b/docs/classes/Query_Builder.html @@ -978,62 +978,62 @@ passed array with key / value pairs  Properties  

Convenience property for connection management

-
$conn_name 
+
$conn_name : string

 

Compiled 'from' clause

-
$from_string 
+
$from_string : string

 

Key/val pairs for group by clause

-
$group_array 
+
$group_array : array

 

Group by clause

-
$group_string 
+
$group_string : string

 

Map for having clause

-
$having_map 
+
$having_map : array

 

Value for limit string

-
$limit 
+
$limit : int

 

Value for offset in limit string

-
$offset 
+
$offset : int

 

Key/val pairs for order by clause

-
$order_array 
+
$order_array : array

 

Order by clause

-
$order_string 
+
$order_string : string

 

Query component order mapping for complex select queries

-
$query_map 
+
$query_map : array

Format:

@@ -1045,37 +1045,37 @@ for complex select queries
 

Compiled 'select' clause

-
$select_string 
+
$select_string : string

 

key/val pairs for insert/update statement

-
$set_array 
+
$set_array : array

 

Keys for insert/update statement

-
$set_array_keys 
+
$set_array_keys : array

 

Compiled arguments for insert / update

-
$set_string 
+
$set_string : string

 

Alias to $this->db->sql

-
$sql 
+
$sql : \DB_PDO

 

Values to apply to prepared statements

-
$values 
+
$values : array

@@ -1086,7 +1086,7 @@ for complex select queries
+ generated on 2012-04-23T13:28:33-04:00.
diff --git a/docs/classes/SQLite.html b/docs/classes/SQLite.html index a413eff..0a9a8ab 100644 --- a/docs/classes/SQLite.html +++ b/docs/classes/SQLite.html @@ -854,7 +854,7 @@ method if the database does not support 'TRUNCATE';  

Reference to the last executed sql query

-
$statement 
+
$statement : \PDOStatement

@@ -865,7 +865,7 @@ method if the database does not support 'TRUNCATE';
+ generated on 2012-04-23T13:28:33-04:00.
diff --git a/docs/classes/SQLite_SQL.html b/docs/classes/SQLite_SQL.html index da98d05..c70379b 100644 --- a/docs/classes/SQLite_SQL.html +++ b/docs/classes/SQLite_SQL.html @@ -280,7 +280,7 @@
+ generated on 2012-04-23T13:28:33-04:00.
diff --git a/docs/classes/SQLite_Util.html b/docs/classes/SQLite_Util.html index 485392a..5353145 100644 --- a/docs/classes/SQLite_Util.html +++ b/docs/classes/SQLite_Util.html @@ -207,7 +207,7 @@
+ generated on 2012-04-23T13:28:33-04:00.
diff --git a/docs/classes/Settings.html b/docs/classes/Settings.html index db920a6..5b70e09 100644 --- a/docs/classes/Settings.html +++ b/docs/classes/Settings.html @@ -243,7 +243,7 @@ directly - the settings should be safe!
+ generated on 2012-04-23T13:28:33-04:00.
diff --git a/docs/deprecated.html b/docs/deprecated.html index 59e3469..0b41597 100644 --- a/docs/deprecated.html +++ b/docs/deprecated.html @@ -66,7 +66,7 @@
+ generated on 2012-04-23T13:28:33-04:00.
diff --git a/docs/errors.html b/docs/errors.html index 449246f..585261b 100644 --- a/docs/errors.html +++ b/docs/errors.html @@ -92,7 +92,7 @@
+ generated on 2012-04-23T13:28:33-04:00.
diff --git a/docs/graph_class.html b/docs/graph_class.html index 2f9b96f..aa3923d 100644 --- a/docs/graph_class.html +++ b/docs/graph_class.html @@ -63,7 +63,7 @@
+ generated on 2012-04-23T13:28:33-04:00.
diff --git a/docs/markers.html b/docs/markers.html index 2499abb..046c7d0 100644 --- a/docs/markers.html +++ b/docs/markers.html @@ -68,7 +68,7 @@
+ generated on 2012-04-23T13:28:33-04:00.
diff --git a/docs/namespaces/default.html b/docs/namespaces/default.html index b7fe931..a18e2c7 100644 --- a/docs/namespaces/default.html +++ b/docs/namespaces/default.html @@ -282,7 +282,7 @@ instantiates the specific db driver

+ generated on 2012-04-23T13:28:33-04:00.
diff --git a/docs/packages/.html b/docs/packages/.html index caa2544..030306c 100644 --- a/docs/packages/.html +++ b/docs/packages/.html @@ -66,7 +66,7 @@
+ generated on 2012-04-23T13:28:33-04:00.
diff --git a/docs/packages/Default.html b/docs/packages/Default.html index 2c64cf8..41a1818 100644 --- a/docs/packages/Default.html +++ b/docs/packages/Default.html @@ -93,7 +93,7 @@
+ generated on 2012-04-23T13:28:33-04:00.
diff --git a/docs/packages/Query.Drivers.html b/docs/packages/Query.Drivers.html index 23443d2..5585171 100644 --- a/docs/packages/Query.Drivers.html +++ b/docs/packages/Query.Drivers.html @@ -210,7 +210,7 @@ data-fetching methods

+ generated on 2012-04-23T13:28:33-04:00.
diff --git a/docs/packages/Query.Helper Classes.html b/docs/packages/Query.Helper Classes.html index 4c1b5a9..efbd06d 100644 --- a/docs/packages/Query.Helper Classes.html +++ b/docs/packages/Query.Helper Classes.html @@ -96,7 +96,7 @@
+ generated on 2012-04-23T13:28:33-04:00.
diff --git a/docs/packages/Query.Query.html b/docs/packages/Query.Query.html index bcbedb4..fb40c24 100644 --- a/docs/packages/Query.Query.html +++ b/docs/packages/Query.Query.html @@ -114,7 +114,7 @@ instantiates the specific db driver

+ generated on 2012-04-23T13:28:33-04:00.
diff --git a/docs/packages/Query.html b/docs/packages/Query.html index 92998cf..effdbb1 100644 --- a/docs/packages/Query.html +++ b/docs/packages/Query.html @@ -315,7 +315,7 @@ instantiates the specific db driver

+ generated on 2012-04-23T13:28:33-04:00.
diff --git a/docs/structure.xml b/docs/structure.xml index 8470f51..73ca393 100644 --- a/docs/structure.xml +++ b/docs/structure.xml @@ -922,134 +922,174 @@ the connection/database]]> - + Free Query Builder / Database Abstraction Layer

]]>
+
- + Query_Builder \Query_Builder - + - - + + - + $select_string - + - - - - $from_string - - - - + + string + + $from_string + + + + + + string + + + + $set_string - + + + string + - + $order_string - + + + string + - + $group_string - + + + string + - + $set_array - + + + array + - + $set_array_keys - + - - - - $order_array - - - - - - - - $group_array - - - - - - - - $values - - - - + + array + - $limit + $order_array - - + + + + array + - - $offset + + $group_array + + + + array + + + + + $values + + + + + + array + + + + + $limit + + + + + + int + + + + + $offset + + + + int + - + $sql - + db->sql]]> + + \DB_PDO + - + $query_map - + Format:

@@ -1059,1017 +1099,1026 @@ for complex select queries]]> 'conjunction' => ' AND ', 'string' => 'k=?' )

]]>
+ + array +
- + $having_map - + + + array + - + $conn_name - + + + string + - + __construct function - + - + object - + $params - + select function - + - + string - + \$this - + $fields - + select_max function - + - + string - + string - + \$this - + $field - + $as - + select_min function - + - + string - + string - + \$this - + $field - + $as - + select_avg function - + - + string - + string - + \$this - + $field - + $as - + select_sum function - + - + string - + string - + \$this - + $field - + $as - + distinct function - + - + \$this - + from function - + - + string - + \$this - + $dbname - + like function - + - + string - + mixed - + string - + \$this - + $field - + $val - + $pos - + or_like function - + - + string - + mixed - + string - + \$this - + $field - + $val - + $pos - + not_like function - + - + string - + mixed - + string - + \$this - + $field - + $val - + $pos - + or_not_like function - + - + string - + mixed - + string - + \$this - + $field - + $val - + $pos - + having function - + - + mixed - + mixed - + \$this - + $key - + $val - + or_having function - + - + mixed - + mixed - + \$this - + $key - + $val - + _where function - + - + mixed - + mixed - + array - + $key - + $val - + where function - + - + mixed - + mixed - + \$this - + $key - + $val - + or_where function - + - + string - + mixed - + \$this - + $field - + $val - + where_in function - + - + mixed - + mixed - + \$this - + $field - + $val - + or_where_in function - + - + string - + mixed - + \$this - + $field - + $val - + where_not_in function - + - + string - + mixed - + \$this - + $field - + $val - + or_where_not_in function - + - + string - + mixed - + \$this - + $field - + $val - + set function - + - + mixed - + mixed - + \$this - + $key - + $val - + join function - + - + string - + string - + string - + \$this - + $table - + $condition - + $type - + group_by function - + - + mixed - + \$this - + $field - + order_by function - + - + string - + string - + \$this - + $field - + $type - + limit function - + - + int - + int - + string - + $limit - + $offset - + group_start function - + - + \$this - + or_group_start function - + - + \$this - + or_not_group_start function - + - + \$this - + group_end function - + - + \$this - + get function - + - - + + int - + int - + object - + $table - + $limit - + $offset - - get_where - function - - - - - string - - - array - - - int - - - int - - - object - - - - $table - - - - - $where - - - - - $limit - - - - - $offset - - - - - - count_all - function - - - - - string - - - int - - - - $table - - - - - count_all_results + get_where function - - + + - + string - + + array + + int + + int + + + object + + $table + + + + + $where + + + + + $limit + + + + + $offset + + + + + + count_all + function + + + + + string + + + int + + + + $table + + + + + + count_all_results + function + + + + + string + + + int + + + $table - + insert function - + - + string - + mixed - + mixed - + $table - + $data - + update function - + - + string - + mixed - + mixed - + $table - + $data - + delete function - + - + string - + mixed - + mixed - + $table - + $where - + __call function - + - + string - + array - + mixed - + $name - + $params - + _reset function - + - + _compile function - + - + string - + string - + \$string - + $type - + $table @@ -2616,7 +2665,7 @@ with array_map and glob]]>
- + Free Query Builder / Database Abstraction Layer

]]>
@@ -2846,7 +2895,7 @@ with array_map and glob]]>
- + Free Query Builder / Database Abstraction Layer

]]>
@@ -3002,7 +3051,7 @@ with array_map and glob]]>
- + Free Query Builder / Database Abstraction Layer

]]>
@@ -3243,7 +3292,7 @@ with array_map and glob]]>
- + Free Query Builder / Database Abstraction Layer

]]>
@@ -3637,7 +3686,7 @@ with array_map and glob]]>
- + Free Query Builder / Database Abstraction Layer

]]>
@@ -3657,135 +3706,138 @@ with array_map and glob]]>
- + $statement + + \PDOStatement + - + __construct function - + - + string - + string - + string - + $dsn - + $user - + $pass - + switch_db function - + - + string - + $name - + truncate function - + - + string - + $table - + get_tables function - + - + mixed - + get_system_tables function - + - + array - + load_database function - + - + string - + string - + $db - + $name - + unload_database function - + - + string - + $name diff --git a/drivers/mysql/mysql_driver.php b/drivers/mysql/mysql_driver.php index 9a26fb9..9311ea7 100644 --- a/drivers/mysql/mysql_driver.php +++ b/drivers/mysql/mysql_driver.php @@ -42,7 +42,7 @@ class MySQL extends DB_PDO { PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES UTF-8 COLLATE 'UTF-8'", )); - parent::__construct("mysql:$dsn", $username, $password, $options); + parent::__construct("mysql:{$dsn}", $username, $password, $options); } // -------------------------------------------------------------------------- diff --git a/drivers/odbc/odbc_driver.php b/drivers/odbc/odbc_driver.php index f64ec7c..8a6eabf 100644 --- a/drivers/odbc/odbc_driver.php +++ b/drivers/odbc/odbc_driver.php @@ -38,7 +38,7 @@ class ODBC extends DB_PDO { */ public function __construct($dsn, $username=null, $password=null, $options=array()) { - parent::__construct("odbc:$dsn", $username, $password, $options); + parent::__construct("odbc:{$dsn}", $username, $password, $options); } // -------------------------------------------------------------------------- diff --git a/drivers/odbc/odbc_sql.php b/drivers/odbc/odbc_sql.php index 9a0e1a8..87468cf 100644 --- a/drivers/odbc/odbc_sql.php +++ b/drivers/odbc/odbc_sql.php @@ -13,12 +13,12 @@ // -------------------------------------------------------------------------- - /** - * ODBC SQL Class - * - * @package Query - * @subpackage Drivers - */ +/** + * ODBC SQL Class + * + * @package Query + * @subpackage Drivers + */ class ODBC_SQL extends DB_SQL { /** diff --git a/drivers/pgsql/pgsql_driver.php b/drivers/pgsql/pgsql_driver.php index f7d975f..df8bebf 100644 --- a/drivers/pgsql/pgsql_driver.php +++ b/drivers/pgsql/pgsql_driver.php @@ -31,7 +31,7 @@ class PgSQL extends DB_PDO { */ public function __construct($dsn, $username=null, $password=null, $options=array()) { - parent::__construct("pgsql:$dsn", $username, $password, $options); + parent::__construct("pgsql:{$dsn}", $username, $password, $options); } // -------------------------------------------------------------------------- diff --git a/drivers/sqlite/sqlite_driver.php b/drivers/sqlite/sqlite_driver.php index 719515a..b042658 100644 --- a/drivers/sqlite/sqlite_driver.php +++ b/drivers/sqlite/sqlite_driver.php @@ -23,6 +23,8 @@ class SQLite extends DB_PDO { /** * Reference to the last executed sql query + * + * @var PDOStatement */ protected $statement; diff --git a/tests/db_files/FB_TEST_DB.FDB b/tests/db_files/FB_TEST_DB.FDB index fad34f9..40708a8 100644 Binary files a/tests/db_files/FB_TEST_DB.FDB and b/tests/db_files/FB_TEST_DB.FDB differ