diff --git a/docs/classes.html b/docs/classes.html index 7141985..8e918a4 100644 --- a/docs/classes.html +++ b/docs/classes.html @@ -107,7 +107,7 @@ - Abstract_Driver + AbstractDriver Base Database class EMPTY @@ -115,7 +115,7 @@ - Abstract_Query_Builder + AbstractQueryBuilder Abstract Class for internal implementation methods of the Query Builder EMPTY @@ -123,7 +123,7 @@ - Abstract_SQL + AbstractSQL parent for database manipulation subclasses EMPTY @@ -131,7 +131,7 @@ - Abstract_Util + AbstractUtil Abstract class defining database / table creation methods EMPTY @@ -147,7 +147,7 @@ - Connection_Manager + ConnectionManager Connection manager class to manage connections for the Query method EMPTY @@ -155,7 +155,7 @@ - Query_Builder + QueryBuilder Convenience class for creating sql queries - also the class that instantiates the specific db driver EMPTY @@ -163,7 +163,7 @@ - Query_Parser + QueryParser Utility Class to parse sql clauses for properly escaping identifiers EMPTY diff --git a/docs/classes/Query_Abstract_Driver.html b/docs/classes/Query_AbstractDriver.html similarity index 71% rename from docs/classes/Query_Abstract_Driver.html rename to docs/classes/Query_AbstractDriver.html index 14647c9..efbe541 100644 --- a/docs/classes/Query_Abstract_Driver.html +++ b/docs/classes/Query_AbstractDriver.html @@ -2,7 +2,7 @@ - phpDox - Query\Abstract_Driver + phpDox - Query\AbstractDriver @@ -41,7 +41,7 @@
  • Query
  • -
  • Abstract_Driver
  • +
  • AbstractDriver
  • -

    Query\Abstract_Driver

    +

    Query\AbstractDriver

    Base Database class

    Extends PDO to simplify cross-database issues

    diff --git a/docs/classes/Query_Abstract_Driver/__call.html b/docs/classes/Query_AbstractDriver/__call.html similarity index 91% rename from docs/classes/Query_Abstract_Driver/__call.html rename to docs/classes/Query_AbstractDriver/__call.html index b6a1e9f..00cd487 100644 --- a/docs/classes/Query_Abstract_Driver/__call.html +++ b/docs/classes/Query_AbstractDriver/__call.html @@ -42,7 +42,7 @@ Query
  • - Abstract_Driver + AbstractDriver
  • __call
  • @@ -62,12 +62,12 @@ Return
  • - Source + Source
  • -

    Query\Abstract_Driver::__call

    +

    Query\AbstractDriver::__call

    Allow invoke to work on table object

    @@ -59,12 +59,12 @@ Parameter
  • - Source + Source
  • -

    Query\Abstract_Driver::__construct

    +

    Query\AbstractDriver::__construct

    PDO constructor wrapper

    @@ -59,12 +59,12 @@ Return
  • - Source + Source
  • -

    Query\Abstract_Driver::_load_sub_classes

    +

    Query\AbstractDriver::_load_sub_classes

    Loads the subclasses for the driver

      diff --git a/docs/classes/Query_Abstract_Driver/_prefix.html b/docs/classes/Query_AbstractDriver/_prefix.html similarity index 91% rename from docs/classes/Query_Abstract_Driver/_prefix.html rename to docs/classes/Query_AbstractDriver/_prefix.html index 31b3870..8fe2860 100644 --- a/docs/classes/Query_Abstract_Driver/_prefix.html +++ b/docs/classes/Query_AbstractDriver/_prefix.html @@ -42,7 +42,7 @@ Query
    • - Abstract_Driver + AbstractDriver
    • _prefix
    @@ -62,12 +62,12 @@ Return
  • - Source + Source
  • -

    Query\Abstract_Driver::_prefix

    +

    Query\AbstractDriver::_prefix

    Sets the table prefix on the passed string

      diff --git a/docs/classes/Query_Abstract_Driver/_quote.html b/docs/classes/Query_AbstractDriver/_quote.html similarity index 91% rename from docs/classes/Query_Abstract_Driver/_quote.html rename to docs/classes/Query_AbstractDriver/_quote.html index 078b70a..9bcf2c3 100644 --- a/docs/classes/Query_Abstract_Driver/_quote.html +++ b/docs/classes/Query_AbstractDriver/_quote.html @@ -42,7 +42,7 @@ Query
    • - Abstract_Driver + AbstractDriver
    • _quote
    @@ -62,12 +62,12 @@ Return
  • - Source + Source
  • -

    Query\Abstract_Driver::_quote

    +

    Query\AbstractDriver::_quote

    Helper method for quote_ident

      diff --git a/docs/classes/Query_Abstract_Driver/affected_rows.html b/docs/classes/Query_AbstractDriver/affected_rows.html similarity index 87% rename from docs/classes/Query_Abstract_Driver/affected_rows.html rename to docs/classes/Query_AbstractDriver/affected_rows.html index d89a2bb..b770f65 100644 --- a/docs/classes/Query_Abstract_Driver/affected_rows.html +++ b/docs/classes/Query_AbstractDriver/affected_rows.html @@ -42,7 +42,7 @@ Query
    • - Abstract_Driver + AbstractDriver
    • affected_rows
    @@ -62,12 +62,12 @@ Interface
  • - Source + Source
  • -

    Query\Abstract_Driver::affected_rows

    +

    Query\AbstractDriver::affected_rows

    Returns number of rows affected by an INSERT, UPDATE, DELETE type query

    diff --git a/docs/classes/Query_Abstract_Driver/driver_query.html b/docs/classes/Query_AbstractDriver/driver_query.html similarity index 89% rename from docs/classes/Query_Abstract_Driver/driver_query.html rename to docs/classes/Query_AbstractDriver/driver_query.html index 0e81d9a..1693a1c 100644 --- a/docs/classes/Query_Abstract_Driver/driver_query.html +++ b/docs/classes/Query_AbstractDriver/driver_query.html @@ -42,7 +42,7 @@ Query
  • - Abstract_Driver + AbstractDriver
  • driver_query
  • @@ -65,12 +65,12 @@ Interface
  • - Source + Source
  • -

    Query\Abstract_Driver::driver_query

    +

    Query\AbstractDriver::driver_query

    Method to simplify retrieving db results for meta-data queries

    diff --git a/docs/classes/Query_Abstract_Driver/get_columns.html b/docs/classes/Query_AbstractDriver/get_columns.html similarity index 88% rename from docs/classes/Query_Abstract_Driver/get_columns.html rename to docs/classes/Query_AbstractDriver/get_columns.html index 0ccaf65..c6888df 100644 --- a/docs/classes/Query_Abstract_Driver/get_columns.html +++ b/docs/classes/Query_AbstractDriver/get_columns.html @@ -42,7 +42,7 @@ Query
  • - Abstract_Driver + AbstractDriver
  • get_columns
  • @@ -65,12 +65,12 @@ Interface
  • - Source + Source
  • -

    Query\Abstract_Driver::get_columns

    +

    Query\AbstractDriver::get_columns

    Retrieve column information for the current database table

    diff --git a/docs/classes/Query_Abstract_Driver/get_dbs.html b/docs/classes/Query_AbstractDriver/get_dbs.html similarity index 87% rename from docs/classes/Query_Abstract_Driver/get_dbs.html rename to docs/classes/Query_AbstractDriver/get_dbs.html index 417a0fc..3c1271a 100644 --- a/docs/classes/Query_Abstract_Driver/get_dbs.html +++ b/docs/classes/Query_AbstractDriver/get_dbs.html @@ -42,7 +42,7 @@ Query
  • - Abstract_Driver + AbstractDriver
  • get_dbs
  • @@ -62,12 +62,12 @@ Interface
  • - Source + Source
  • -

    Query\Abstract_Driver::get_dbs

    +

    Query\AbstractDriver::get_dbs

    Return list of dbs for the current connection, if possible

    diff --git a/docs/classes/Query_Abstract_Driver/get_fks.html b/docs/classes/Query_AbstractDriver/get_fks.html similarity index 88% rename from docs/classes/Query_Abstract_Driver/get_fks.html rename to docs/classes/Query_AbstractDriver/get_fks.html index a554f88..6731c30 100644 --- a/docs/classes/Query_Abstract_Driver/get_fks.html +++ b/docs/classes/Query_AbstractDriver/get_fks.html @@ -42,7 +42,7 @@ Query
  • - Abstract_Driver + AbstractDriver
  • get_fks
  • @@ -65,12 +65,12 @@ Interface
  • - Source + Source
  • -

    Query\Abstract_Driver::get_fks

    +

    Query\AbstractDriver::get_fks

    Retrieve foreign keys for the table

    diff --git a/docs/classes/Query_Abstract_Driver/get_functions.html b/docs/classes/Query_AbstractDriver/get_functions.html similarity index 87% rename from docs/classes/Query_Abstract_Driver/get_functions.html rename to docs/classes/Query_AbstractDriver/get_functions.html index a44c39d..56d7a87 100644 --- a/docs/classes/Query_Abstract_Driver/get_functions.html +++ b/docs/classes/Query_AbstractDriver/get_functions.html @@ -42,7 +42,7 @@ Query
  • - Abstract_Driver + AbstractDriver
  • get_functions
  • @@ -62,12 +62,12 @@ Interface
  • - Source + Source
  • -

    Query\Abstract_Driver::get_functions

    +

    Query\AbstractDriver::get_functions

    Return list of functions for the current database

    diff --git a/docs/classes/Query_Abstract_Driver/get_indexes.html b/docs/classes/Query_AbstractDriver/get_indexes.html similarity index 88% rename from docs/classes/Query_Abstract_Driver/get_indexes.html rename to docs/classes/Query_AbstractDriver/get_indexes.html index 925cdfc..10311b2 100644 --- a/docs/classes/Query_Abstract_Driver/get_indexes.html +++ b/docs/classes/Query_AbstractDriver/get_indexes.html @@ -42,7 +42,7 @@ Query
  • - Abstract_Driver + AbstractDriver
  • get_indexes
  • @@ -65,12 +65,12 @@ Interface
  • - Source + Source
  • -

    Query\Abstract_Driver::get_indexes

    +

    Query\AbstractDriver::get_indexes

    Retrieve indexes for the table

    diff --git a/docs/classes/Query_Abstract_Driver/get_last_query.html b/docs/classes/Query_AbstractDriver/get_last_query.html similarity index 89% rename from docs/classes/Query_Abstract_Driver/get_last_query.html rename to docs/classes/Query_AbstractDriver/get_last_query.html index b827a50..7dbee4c 100644 --- a/docs/classes/Query_Abstract_Driver/get_last_query.html +++ b/docs/classes/Query_AbstractDriver/get_last_query.html @@ -42,7 +42,7 @@ Query
  • - Abstract_Driver + AbstractDriver
  • get_last_query
  • @@ -59,12 +59,12 @@ Return
  • - Source + Source
  • -

    Query\Abstract_Driver::get_last_query

    +

    Query\AbstractDriver::get_last_query

    Get the last sql query exexcuted

      diff --git a/docs/classes/Query_Abstract_Driver/get_procedures.html b/docs/classes/Query_AbstractDriver/get_procedures.html similarity index 87% rename from docs/classes/Query_Abstract_Driver/get_procedures.html rename to docs/classes/Query_AbstractDriver/get_procedures.html index 8a37ced..7ea028a 100644 --- a/docs/classes/Query_Abstract_Driver/get_procedures.html +++ b/docs/classes/Query_AbstractDriver/get_procedures.html @@ -42,7 +42,7 @@ Query
    • - Abstract_Driver + AbstractDriver
    • get_procedures
    @@ -62,12 +62,12 @@ Interface
  • - Source + Source
  • -

    Query\Abstract_Driver::get_procedures

    +

    Query\AbstractDriver::get_procedures

    Return list of stored procedures for the current database

    diff --git a/docs/classes/Query_Abstract_Driver/get_schemas.html b/docs/classes/Query_AbstractDriver/get_schemas.html similarity index 90% rename from docs/classes/Query_Abstract_Driver/get_schemas.html rename to docs/classes/Query_AbstractDriver/get_schemas.html index 507a186..e915bc5 100644 --- a/docs/classes/Query_Abstract_Driver/get_schemas.html +++ b/docs/classes/Query_AbstractDriver/get_schemas.html @@ -42,7 +42,7 @@ Query
  • - Abstract_Driver + AbstractDriver
  • get_schemas
  • @@ -59,12 +59,12 @@ Return
  • - Source + Source
  • -

    Query\Abstract_Driver::get_schemas

    +

    Query\AbstractDriver::get_schemas

    Return schemas for databases that list them

      diff --git a/docs/classes/Query_Abstract_Driver/get_sequences.html b/docs/classes/Query_AbstractDriver/get_sequences.html similarity index 87% rename from docs/classes/Query_Abstract_Driver/get_sequences.html rename to docs/classes/Query_AbstractDriver/get_sequences.html index ab381cc..9729668 100644 --- a/docs/classes/Query_Abstract_Driver/get_sequences.html +++ b/docs/classes/Query_AbstractDriver/get_sequences.html @@ -42,7 +42,7 @@ Query
    • - Abstract_Driver + AbstractDriver
    • get_sequences
    @@ -62,12 +62,12 @@ Interface
  • - Source + Source
  • -

    Query\Abstract_Driver::get_sequences

    +

    Query\AbstractDriver::get_sequences

    Return list of sequences for the current database, if they exist

    diff --git a/docs/classes/Query_Abstract_Driver/get_sql.html b/docs/classes/Query_AbstractDriver/get_sql.html similarity index 87% rename from docs/classes/Query_Abstract_Driver/get_sql.html rename to docs/classes/Query_AbstractDriver/get_sql.html index 968d8c9..15030d4 100644 --- a/docs/classes/Query_Abstract_Driver/get_sql.html +++ b/docs/classes/Query_AbstractDriver/get_sql.html @@ -42,7 +42,7 @@ Query
  • - Abstract_Driver + AbstractDriver
  • get_sql
  • @@ -62,12 +62,12 @@ Interface
  • - Source + Source
  • -

    Query\Abstract_Driver::get_sql

    +

    Query\AbstractDriver::get_sql

    Get the SQL class for the current driver

    diff --git a/docs/classes/Query_Abstract_Driver/get_system_tables.html b/docs/classes/Query_AbstractDriver/get_system_tables.html similarity index 87% rename from docs/classes/Query_Abstract_Driver/get_system_tables.html rename to docs/classes/Query_AbstractDriver/get_system_tables.html index 5a9ba9f..1c9b820 100644 --- a/docs/classes/Query_Abstract_Driver/get_system_tables.html +++ b/docs/classes/Query_AbstractDriver/get_system_tables.html @@ -42,7 +42,7 @@ Query
  • - Abstract_Driver + AbstractDriver
  • get_system_tables
  • @@ -62,12 +62,12 @@ Interface
  • - Source + Source
  • -

    Query\Abstract_Driver::get_system_tables

    +

    Query\AbstractDriver::get_system_tables

    Retrieves an array of non-user-created tables for the connection/database

    diff --git a/docs/classes/Query_Abstract_Driver/get_tables.html b/docs/classes/Query_AbstractDriver/get_tables.html similarity index 87% rename from docs/classes/Query_Abstract_Driver/get_tables.html rename to docs/classes/Query_AbstractDriver/get_tables.html index 25e9399..c4faa4f 100644 --- a/docs/classes/Query_Abstract_Driver/get_tables.html +++ b/docs/classes/Query_AbstractDriver/get_tables.html @@ -42,7 +42,7 @@ Query
  • - Abstract_Driver + AbstractDriver
  • get_tables
  • @@ -62,12 +62,12 @@ Interface
  • - Source + Source
  • -

    Query\Abstract_Driver::get_tables

    +

    Query\AbstractDriver::get_tables

    Return list of tables for the current database

    diff --git a/docs/classes/Query_Abstract_Driver/get_triggers.html b/docs/classes/Query_AbstractDriver/get_triggers.html similarity index 87% rename from docs/classes/Query_Abstract_Driver/get_triggers.html rename to docs/classes/Query_AbstractDriver/get_triggers.html index c44e579..565fe75 100644 --- a/docs/classes/Query_Abstract_Driver/get_triggers.html +++ b/docs/classes/Query_AbstractDriver/get_triggers.html @@ -42,7 +42,7 @@ Query
  • - Abstract_Driver + AbstractDriver
  • get_triggers
  • @@ -62,12 +62,12 @@ Interface
  • - Source + Source
  • -

    Query\Abstract_Driver::get_triggers

    +

    Query\AbstractDriver::get_triggers

    Return list of triggers for the current database

    diff --git a/docs/classes/Query_Abstract_Driver/get_types.html b/docs/classes/Query_AbstractDriver/get_types.html similarity index 87% rename from docs/classes/Query_Abstract_Driver/get_types.html rename to docs/classes/Query_AbstractDriver/get_types.html index 3c3cbe6..566c4a6 100644 --- a/docs/classes/Query_Abstract_Driver/get_types.html +++ b/docs/classes/Query_AbstractDriver/get_types.html @@ -42,7 +42,7 @@ Query
  • - Abstract_Driver + AbstractDriver
  • get_types
  • @@ -62,12 +62,12 @@ Interface
  • - Source + Source
  • -

    Query\Abstract_Driver::get_types

    +

    Query\AbstractDriver::get_types

    Retrieve list of data types for the database

    diff --git a/docs/classes/Query_Abstract_Driver/get_util.html b/docs/classes/Query_AbstractDriver/get_util.html similarity index 87% rename from docs/classes/Query_Abstract_Driver/get_util.html rename to docs/classes/Query_AbstractDriver/get_util.html index 1f3a044..514e6e3 100644 --- a/docs/classes/Query_Abstract_Driver/get_util.html +++ b/docs/classes/Query_AbstractDriver/get_util.html @@ -42,7 +42,7 @@ Query
  • - Abstract_Driver + AbstractDriver
  • get_util
  • @@ -62,12 +62,12 @@ Interface
  • - Source + Source
  • -

    Query\Abstract_Driver::get_util

    +

    Query\AbstractDriver::get_util

    Get the Util class for the current driver

    diff --git a/docs/classes/Query_Abstract_Driver/get_views.html b/docs/classes/Query_AbstractDriver/get_views.html similarity index 87% rename from docs/classes/Query_Abstract_Driver/get_views.html rename to docs/classes/Query_AbstractDriver/get_views.html index 4055719..bd0d03b 100644 --- a/docs/classes/Query_Abstract_Driver/get_views.html +++ b/docs/classes/Query_AbstractDriver/get_views.html @@ -42,7 +42,7 @@ Query
  • - Abstract_Driver + AbstractDriver
  • get_views
  • @@ -62,12 +62,12 @@ Interface
  • - Source + Source
  • -

    Query\Abstract_Driver::get_views

    +

    Query\AbstractDriver::get_views

    Return list of views for the current database

    diff --git a/docs/classes/Query_Abstract_Driver/insert_batch.html b/docs/classes/Query_AbstractDriver/insert_batch.html similarity index 88% rename from docs/classes/Query_Abstract_Driver/insert_batch.html rename to docs/classes/Query_AbstractDriver/insert_batch.html index 16908b3..a932267 100644 --- a/docs/classes/Query_Abstract_Driver/insert_batch.html +++ b/docs/classes/Query_AbstractDriver/insert_batch.html @@ -42,7 +42,7 @@ Query
  • - Abstract_Driver + AbstractDriver
  • insert_batch
  • @@ -65,12 +65,12 @@ Interface
  • - Source + Source
  • -

    Query\Abstract_Driver::insert_batch

    +

    Query\AbstractDriver::insert_batch

    Create sql for batch insert

    diff --git a/docs/classes/Query_Abstract_Driver/num_rows.html b/docs/classes/Query_AbstractDriver/num_rows.html similarity index 87% rename from docs/classes/Query_Abstract_Driver/num_rows.html rename to docs/classes/Query_AbstractDriver/num_rows.html index f896b1d..ea2d134 100644 --- a/docs/classes/Query_Abstract_Driver/num_rows.html +++ b/docs/classes/Query_AbstractDriver/num_rows.html @@ -42,7 +42,7 @@ Query
  • - Abstract_Driver + AbstractDriver
  • num_rows
  • @@ -62,12 +62,12 @@ Interface
  • - Source + Source
  • -

    Query\Abstract_Driver::num_rows

    +

    Query\AbstractDriver::num_rows

    Return the number of rows returned for a SELECT query

    diff --git a/docs/classes/Query_Abstract_Driver/prefix_table.html b/docs/classes/Query_AbstractDriver/prefix_table.html similarity index 88% rename from docs/classes/Query_Abstract_Driver/prefix_table.html rename to docs/classes/Query_AbstractDriver/prefix_table.html index e6b6e46..5ba93d6 100644 --- a/docs/classes/Query_Abstract_Driver/prefix_table.html +++ b/docs/classes/Query_AbstractDriver/prefix_table.html @@ -42,7 +42,7 @@ Query
  • - Abstract_Driver + AbstractDriver
  • prefix_table
  • @@ -65,12 +65,12 @@ Interface
  • - Source + Source
  • -

    Query\Abstract_Driver::prefix_table

    +

    Query\AbstractDriver::prefix_table

    Prefixes a table if it is not already prefixed

    diff --git a/docs/classes/Query_Abstract_Driver/prepare_execute.html b/docs/classes/Query_AbstractDriver/prepare_execute.html similarity index 88% rename from docs/classes/Query_Abstract_Driver/prepare_execute.html rename to docs/classes/Query_AbstractDriver/prepare_execute.html index 218deb9..2433e59 100644 --- a/docs/classes/Query_Abstract_Driver/prepare_execute.html +++ b/docs/classes/Query_AbstractDriver/prepare_execute.html @@ -42,7 +42,7 @@ Query
  • - Abstract_Driver + AbstractDriver
  • prepare_execute
  • @@ -65,12 +65,12 @@ Interface
  • - Source + Source
  • -

    Query\Abstract_Driver::prepare_execute

    +

    Query\AbstractDriver::prepare_execute

    Create and execute a prepared statement with the provided parameters

    diff --git a/docs/classes/Query_Abstract_Driver/prepare_query.html b/docs/classes/Query_AbstractDriver/prepare_query.html similarity index 89% rename from docs/classes/Query_Abstract_Driver/prepare_query.html rename to docs/classes/Query_AbstractDriver/prepare_query.html index 83d7381..a1bf31f 100644 --- a/docs/classes/Query_Abstract_Driver/prepare_query.html +++ b/docs/classes/Query_AbstractDriver/prepare_query.html @@ -42,7 +42,7 @@ Query
  • - Abstract_Driver + AbstractDriver
  • prepare_query
  • @@ -68,12 +68,12 @@ Interface
  • - Source + Source
  • -

    Query\Abstract_Driver::prepare_query

    +

    Query\AbstractDriver::prepare_query

    Simplifies prepared statements for database queries

    diff --git a/docs/classes/Query_Abstract_Driver/quote_ident.html b/docs/classes/Query_AbstractDriver/quote_ident.html similarity index 88% rename from docs/classes/Query_Abstract_Driver/quote_ident.html rename to docs/classes/Query_AbstractDriver/quote_ident.html index 6a36e56..607eff9 100644 --- a/docs/classes/Query_Abstract_Driver/quote_ident.html +++ b/docs/classes/Query_AbstractDriver/quote_ident.html @@ -42,7 +42,7 @@ Query
  • - Abstract_Driver + AbstractDriver
  • quote_ident
  • @@ -65,12 +65,12 @@ Interface
  • - Source + Source
  • -

    Query\Abstract_Driver::quote_ident

    +

    Query\AbstractDriver::quote_ident

    Surrounds the string with the databases identifier escape characters

    diff --git a/docs/classes/Query_Abstract_Driver/quote_table.html b/docs/classes/Query_AbstractDriver/quote_table.html similarity index 88% rename from docs/classes/Query_Abstract_Driver/quote_table.html rename to docs/classes/Query_AbstractDriver/quote_table.html index 6268408..25b2d60 100644 --- a/docs/classes/Query_Abstract_Driver/quote_table.html +++ b/docs/classes/Query_AbstractDriver/quote_table.html @@ -42,7 +42,7 @@ Query
  • - Abstract_Driver + AbstractDriver
  • quote_table
  • @@ -65,12 +65,12 @@ Interface
  • - Source + Source
  • -

    Query\Abstract_Driver::quote_table

    +

    Query\AbstractDriver::quote_table

    Quote database table name, and set prefix

    diff --git a/docs/classes/Query_Abstract_Driver/set_last_query.html b/docs/classes/Query_AbstractDriver/set_last_query.html similarity index 90% rename from docs/classes/Query_Abstract_Driver/set_last_query.html rename to docs/classes/Query_AbstractDriver/set_last_query.html index 84fdb0c..f0791b2 100644 --- a/docs/classes/Query_Abstract_Driver/set_last_query.html +++ b/docs/classes/Query_AbstractDriver/set_last_query.html @@ -42,7 +42,7 @@ Query
  • - Abstract_Driver + AbstractDriver
  • set_last_query
  • @@ -62,12 +62,12 @@ Return
  • - Source + Source
  • -

    Query\Abstract_Driver::set_last_query

    +

    Query\AbstractDriver::set_last_query

    Set the last query sql

      diff --git a/docs/classes/Query_Abstract_Driver/set_table_prefix.html b/docs/classes/Query_AbstractDriver/set_table_prefix.html similarity index 90% rename from docs/classes/Query_Abstract_Driver/set_table_prefix.html rename to docs/classes/Query_AbstractDriver/set_table_prefix.html index e055124..c8e3ddc 100644 --- a/docs/classes/Query_Abstract_Driver/set_table_prefix.html +++ b/docs/classes/Query_AbstractDriver/set_table_prefix.html @@ -42,7 +42,7 @@ Query
    • - Abstract_Driver + AbstractDriver
    • set_table_prefix
    @@ -62,12 +62,12 @@ Return
  • - Source + Source
  • -

    Query\Abstract_Driver::set_table_prefix

    +

    Query\AbstractDriver::set_table_prefix

    Set the common table name prefix

      diff --git a/docs/classes/Query_Abstract_Driver/truncate.html b/docs/classes/Query_AbstractDriver/truncate.html similarity index 91% rename from docs/classes/Query_Abstract_Driver/truncate.html rename to docs/classes/Query_AbstractDriver/truncate.html index 1c29c6f..e1bd9e2 100644 --- a/docs/classes/Query_Abstract_Driver/truncate.html +++ b/docs/classes/Query_AbstractDriver/truncate.html @@ -42,7 +42,7 @@ Query
    • - Abstract_Driver + AbstractDriver
    • truncate
    @@ -62,12 +62,12 @@ Return
  • - Source + Source
  • -

    Query\Abstract_Driver::truncate

    +

    Query\AbstractDriver::truncate

    Empty the passed table

      diff --git a/docs/classes/Query_Abstract_Query_Builder.html b/docs/classes/Query_AbstractQueryBuilder.html similarity index 78% rename from docs/classes/Query_Abstract_Query_Builder.html rename to docs/classes/Query_AbstractQueryBuilder.html index 730df12..17f71b6 100644 --- a/docs/classes/Query_Abstract_Query_Builder.html +++ b/docs/classes/Query_AbstractQueryBuilder.html @@ -2,7 +2,7 @@ - phpDox - Query\Abstract_Query_Builder + phpDox - Query\AbstractQueryBuilder @@ -41,7 +41,7 @@
    • Query
    • -
    • Abstract_Query_Builder
    • +
    • AbstractQueryBuilder
    -

    Query\Abstract_Query_Builder

    +

    Query\AbstractQueryBuilder

    Abstract Class for internal implementation methods of the Query Builder

    Methods

    protected

    History

      +
    • +

      2015-11-10T10:12:23-05:00 (commit #b5a141f)

      +
      +

      + Author: Timothy J Warren (tim@timshomepage.net) / + Commiter: Timothy J Warren (tim@timshomepage.net) +

      +
      Make class names Pascal Case
      +
      +
    • +
    • +

      2015-11-10T09:24:18-05:00 (commit #39cd2ec)

      +
      +

      + Author: Timothy J Warren (tim@timshomepage.net) / + Commiter: Timothy J Warren (tim@timshomepage.net) +

      +
      Fix borkeed tests
      +
      +
    • 2015-07-31T10:24:34-04:00 (commit #056e8bf)

      @@ -390,16 +410,6 @@
      Remove some variable setting logic duplication
    • -
    • -

      2014-04-24T17:07:50-04:00 (commit #81be910)

      -
      -

      - Author: Timothy J. Warren (tim@timshomepage.net) / - Commiter: Timothy J. Warren (tim@timshomepage.net) -

      -
      Split Query Builder class
      -
      -
    diff --git a/docs/classes/Query_Abstract_Query_Builder/_append_map.html b/docs/classes/Query_AbstractQueryBuilder/_append_map.html similarity index 90% rename from docs/classes/Query_Abstract_Query_Builder/_append_map.html rename to docs/classes/Query_AbstractQueryBuilder/_append_map.html index c7fa122..4d6313a 100644 --- a/docs/classes/Query_Abstract_Query_Builder/_append_map.html +++ b/docs/classes/Query_AbstractQueryBuilder/_append_map.html @@ -42,7 +42,7 @@ Query
  • - Abstract_Query_Builder + AbstractQueryBuilder
  • _append_map
  • @@ -62,12 +62,12 @@ Return
  • - Source + Source
  • -

    Query\Abstract_Query_Builder::_append_map

    +

    Query\AbstractQueryBuilder::_append_map

    Add an additional set of mapping pairs to a internal map

      diff --git a/docs/classes/Query_Abstract_Query_Builder/_append_query.html b/docs/classes/Query_AbstractQueryBuilder/_append_query.html similarity index 90% rename from docs/classes/Query_Abstract_Query_Builder/_append_query.html rename to docs/classes/Query_AbstractQueryBuilder/_append_query.html index 2618993..4c30bf6 100644 --- a/docs/classes/Query_Abstract_Query_Builder/_append_query.html +++ b/docs/classes/Query_AbstractQueryBuilder/_append_query.html @@ -42,7 +42,7 @@ Query
    • - Abstract_Query_Builder + AbstractQueryBuilder
    • _append_query
    @@ -62,12 +62,12 @@ Return
  • - Source + Source
  • -

    Query\Abstract_Query_Builder::_append_query

    +

    Query\AbstractQueryBuilder::_append_query

    Convert the prepared statement into readable sql

      diff --git a/docs/classes/Query_Abstract_Query_Builder/_compile.html b/docs/classes/Query_AbstractQueryBuilder/_compile.html similarity index 90% rename from docs/classes/Query_Abstract_Query_Builder/_compile.html rename to docs/classes/Query_AbstractQueryBuilder/_compile.html index a65dcc1..5975cb9 100644 --- a/docs/classes/Query_Abstract_Query_Builder/_compile.html +++ b/docs/classes/Query_AbstractQueryBuilder/_compile.html @@ -42,7 +42,7 @@ Query
    • - Abstract_Query_Builder + AbstractQueryBuilder
    • _compile
    @@ -62,12 +62,12 @@ Return
  • - Source + Source
  • -

    Query\Abstract_Query_Builder::_compile

    +

    Query\AbstractQueryBuilder::_compile

    String together the sql statements for sending to the db

      diff --git a/docs/classes/Query_Abstract_Query_Builder/_compile_type.html b/docs/classes/Query_AbstractQueryBuilder/_compile_type.html similarity index 90% rename from docs/classes/Query_Abstract_Query_Builder/_compile_type.html rename to docs/classes/Query_AbstractQueryBuilder/_compile_type.html index 478bc67..be9ae5c 100644 --- a/docs/classes/Query_Abstract_Query_Builder/_compile_type.html +++ b/docs/classes/Query_AbstractQueryBuilder/_compile_type.html @@ -42,7 +42,7 @@ Query
    • - Abstract_Query_Builder + AbstractQueryBuilder
    • _compile_type
    @@ -62,12 +62,12 @@ Return
  • - Source + Source
  • -

    Query\Abstract_Query_Builder::_compile_type

    +

    Query\AbstractQueryBuilder::_compile_type

    Sub-method for generating sql strings

      diff --git a/docs/classes/Query_Abstract_Query_Builder/_get_compile.html b/docs/classes/Query_AbstractQueryBuilder/_get_compile.html similarity index 90% rename from docs/classes/Query_Abstract_Query_Builder/_get_compile.html rename to docs/classes/Query_AbstractQueryBuilder/_get_compile.html index 8dc83a6..ed9e6fb 100644 --- a/docs/classes/Query_Abstract_Query_Builder/_get_compile.html +++ b/docs/classes/Query_AbstractQueryBuilder/_get_compile.html @@ -42,7 +42,7 @@ Query
    • - Abstract_Query_Builder + AbstractQueryBuilder
    • _get_compile
    @@ -62,12 +62,12 @@ Return
  • - Source + Source
  • -

    Query\Abstract_Query_Builder::_get_compile

    +

    Query\AbstractQueryBuilder::_get_compile

    Helper function for returning sql strings

      diff --git a/docs/classes/Query_Abstract_Query_Builder/_having.html b/docs/classes/Query_AbstractQueryBuilder/_having.html similarity index 90% rename from docs/classes/Query_Abstract_Query_Builder/_having.html rename to docs/classes/Query_AbstractQueryBuilder/_having.html index cc73500..de4e101 100644 --- a/docs/classes/Query_Abstract_Query_Builder/_having.html +++ b/docs/classes/Query_AbstractQueryBuilder/_having.html @@ -42,7 +42,7 @@ Query
    • - Abstract_Query_Builder + AbstractQueryBuilder
    • _having
    @@ -62,12 +62,12 @@ Return
  • - Source + Source
  • -

    Query\Abstract_Query_Builder::_having

    +

    Query\AbstractQueryBuilder::_having

    Simplify building having clauses

      diff --git a/docs/classes/Query_Abstract_Query_Builder/_like.html b/docs/classes/Query_AbstractQueryBuilder/_like.html similarity index 91% rename from docs/classes/Query_Abstract_Query_Builder/_like.html rename to docs/classes/Query_AbstractQueryBuilder/_like.html index 7d66f87..9c1384d 100644 --- a/docs/classes/Query_Abstract_Query_Builder/_like.html +++ b/docs/classes/Query_AbstractQueryBuilder/_like.html @@ -42,7 +42,7 @@ Query
    • - Abstract_Query_Builder + AbstractQueryBuilder
    • _like
    @@ -62,12 +62,12 @@ Return
  • - Source + Source
  • -

    Query\Abstract_Query_Builder::_like

    +

    Query\AbstractQueryBuilder::_like

    Simplify 'like' methods

      diff --git a/docs/classes/Query_Abstract_Query_Builder/_mixed_set.html b/docs/classes/Query_AbstractQueryBuilder/_mixed_set.html similarity index 91% rename from docs/classes/Query_Abstract_Query_Builder/_mixed_set.html rename to docs/classes/Query_AbstractQueryBuilder/_mixed_set.html index 63f4ca9..9447b07 100644 --- a/docs/classes/Query_Abstract_Query_Builder/_mixed_set.html +++ b/docs/classes/Query_AbstractQueryBuilder/_mixed_set.html @@ -42,7 +42,7 @@ Query
    • - Abstract_Query_Builder + AbstractQueryBuilder
    • _mixed_set
    @@ -62,12 +62,12 @@ Return
  • - Source + Source
  • -

    Query\Abstract_Query_Builder::_mixed_set

    +

    Query\AbstractQueryBuilder::_mixed_set

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

      diff --git a/docs/classes/Query_Abstract_Query_Builder/_run.html b/docs/classes/Query_AbstractQueryBuilder/_run.html similarity index 91% rename from docs/classes/Query_Abstract_Query_Builder/_run.html rename to docs/classes/Query_AbstractQueryBuilder/_run.html index b555fe8..e24bf3e 100644 --- a/docs/classes/Query_Abstract_Query_Builder/_run.html +++ b/docs/classes/Query_AbstractQueryBuilder/_run.html @@ -42,7 +42,7 @@ Query
    • - Abstract_Query_Builder + AbstractQueryBuilder
    • _run
    @@ -62,12 +62,12 @@ Return
  • - Source + Source
  • -

    Query\Abstract_Query_Builder::_run

    +

    Query\AbstractQueryBuilder::_run

    Executes the compiled query

      diff --git a/docs/classes/Query_Abstract_Query_Builder/_select.html b/docs/classes/Query_AbstractQueryBuilder/_select.html similarity index 90% rename from docs/classes/Query_Abstract_Query_Builder/_select.html rename to docs/classes/Query_AbstractQueryBuilder/_select.html index b5cc588..5861091 100644 --- a/docs/classes/Query_Abstract_Query_Builder/_select.html +++ b/docs/classes/Query_AbstractQueryBuilder/_select.html @@ -42,7 +42,7 @@ Query
    • - Abstract_Query_Builder + AbstractQueryBuilder
    • _select
    @@ -62,12 +62,12 @@ Return
  • - Source + Source
  • -

    Query\Abstract_Query_Builder::_select

    +

    Query\AbstractQueryBuilder::_select

    Method to simplify select_ methods

      diff --git a/docs/classes/Query_Abstract_Query_Builder/_where.html b/docs/classes/Query_AbstractQueryBuilder/_where.html similarity index 90% rename from docs/classes/Query_Abstract_Query_Builder/_where.html rename to docs/classes/Query_AbstractQueryBuilder/_where.html index 8d9392a..652a324 100644 --- a/docs/classes/Query_Abstract_Query_Builder/_where.html +++ b/docs/classes/Query_AbstractQueryBuilder/_where.html @@ -42,7 +42,7 @@ Query
    • - Abstract_Query_Builder + AbstractQueryBuilder
    • _where
    @@ -62,12 +62,12 @@ Return
  • - Source + Source
  • -

    Query\Abstract_Query_Builder::_where

    +

    Query\AbstractQueryBuilder::_where

    Do all the repeditive stuff for where/having type methods

      diff --git a/docs/classes/Query_Abstract_Query_Builder/_where_in.html b/docs/classes/Query_AbstractQueryBuilder/_where_in.html similarity index 91% rename from docs/classes/Query_Abstract_Query_Builder/_where_in.html rename to docs/classes/Query_AbstractQueryBuilder/_where_in.html index d8aa4b3..2e69769 100644 --- a/docs/classes/Query_Abstract_Query_Builder/_where_in.html +++ b/docs/classes/Query_AbstractQueryBuilder/_where_in.html @@ -42,7 +42,7 @@ Query
    • - Abstract_Query_Builder + AbstractQueryBuilder
    • _where_in
    @@ -62,12 +62,12 @@ Return
  • - Source + Source
  • -

    Query\Abstract_Query_Builder::_where_in

    +

    Query\AbstractQueryBuilder::_where_in

    Simplify where_in methods

      diff --git a/docs/classes/Query_Abstract_Query_Builder/_where_string.html b/docs/classes/Query_AbstractQueryBuilder/_where_string.html similarity index 90% rename from docs/classes/Query_Abstract_Query_Builder/_where_string.html rename to docs/classes/Query_AbstractQueryBuilder/_where_string.html index cf5deb4..8bfa595 100644 --- a/docs/classes/Query_Abstract_Query_Builder/_where_string.html +++ b/docs/classes/Query_AbstractQueryBuilder/_where_string.html @@ -42,7 +42,7 @@ Query
    • - Abstract_Query_Builder + AbstractQueryBuilder
    • _where_string
    @@ -62,12 +62,12 @@ Return
  • - Source + Source
  • -

    Query\Abstract_Query_Builder::_where_string

    +

    Query\AbstractQueryBuilder::_where_string

    Simplify generating where string

      diff --git a/docs/classes/Query_Abstract_SQL.html b/docs/classes/Query_AbstractSQL.html similarity index 87% rename from docs/classes/Query_Abstract_SQL.html rename to docs/classes/Query_AbstractSQL.html index a5f7359..2558bc5 100644 --- a/docs/classes/Query_Abstract_SQL.html +++ b/docs/classes/Query_AbstractSQL.html @@ -2,7 +2,7 @@ - phpDox - Query\Abstract_SQL + phpDox - Query\AbstractSQL @@ -41,7 +41,7 @@
    • Query
    • -
    • Abstract_SQL
    • +
    • AbstractSQL
    -

    Query\Abstract_SQL

    +

    Query\AbstractSQL

    parent for database manipulation subclasses

      Synopsis

      -
      class Abstract_SQL +
      class AbstractSQL implements - SQL_Interface - {
      @@ -84,7 +84,7 @@

      Implements

      @@ -92,12 +92,22 @@

      public

      History

        +
      • +

        2015-11-10T10:12:23-05:00 (commit #b5a141f)

        +
        +

        + Author: Timothy J Warren (tim@timshomepage.net) / + Commiter: Timothy J Warren (tim@timshomepage.net) +

        +
        Make class names Pascal Case
        +
        +
      • 2015-07-29T16:51:17-04:00 (commit #8511c6a)

        diff --git a/docs/classes/Query_Abstract_SQL/limit.html b/docs/classes/Query_AbstractSQL/limit.html similarity index 89% rename from docs/classes/Query_Abstract_SQL/limit.html rename to docs/classes/Query_AbstractSQL/limit.html index 362dc10..8597432 100644 --- a/docs/classes/Query_Abstract_SQL/limit.html +++ b/docs/classes/Query_AbstractSQL/limit.html @@ -42,7 +42,7 @@ Query
      • - Abstract_SQL + AbstractSQL
      • limit
      @@ -65,12 +65,12 @@ Interface
    • - Source + Source
    -

    Query\Abstract_SQL::limit

    +

    Query\AbstractSQL::limit

    Limit clause

    diff --git a/docs/classes/Query_Abstract_Util.html b/docs/classes/Query_AbstractUtil.html similarity index 84% rename from docs/classes/Query_Abstract_Util.html rename to docs/classes/Query_AbstractUtil.html index 148e0f8..cd50222 100644 --- a/docs/classes/Query_Abstract_Util.html +++ b/docs/classes/Query_AbstractUtil.html @@ -2,7 +2,7 @@ - phpDox - Query\Abstract_Util + phpDox - Query\AbstractUtil @@ -41,7 +41,7 @@
  • Query
  • -
  • Abstract_Util
  • +
  • AbstractUtil
  • -

    Query\Abstract_Util

    +

    Query\AbstractUtil

    Abstract class defining database / table creation methods

      Synopsis

      -
      class Abstract_Util +
      class AbstractUtil {
      • // members
      • private  $conn; -
      }
      @@ -98,22 +98,32 @@

      public

      History

        +
      • +

        2015-11-10T10:12:23-05:00 (commit #b5a141f)

        +
        +

        + Author: Timothy J Warren (tim@timshomepage.net) / + Commiter: Timothy J Warren (tim@timshomepage.net) +

        +
        Make class names Pascal Case
        +
        +
      • 2015-07-29T16:51:17-04:00 (commit #8511c6a)

        @@ -264,16 +274,6 @@
        Add insert_batch methods to Firebird and SQLite
      • -
      • -

        2014-04-02T17:08:50-04:00 (commit #e3fdad5)

        -
        -

        - Author: Timothy J. Warren (tim@timshomepage.net) / - Commiter: Timothy J. Warren (tim@timshomepage.net) -

        -
        Namespaces!
        -
        -
    diff --git a/docs/classes/Query_Abstract_Util/__construct.html b/docs/classes/Query_AbstractUtil/__construct.html similarity index 88% rename from docs/classes/Query_Abstract_Util/__construct.html rename to docs/classes/Query_AbstractUtil/__construct.html index e17554a..83ebd6f 100644 --- a/docs/classes/Query_Abstract_Util/__construct.html +++ b/docs/classes/Query_AbstractUtil/__construct.html @@ -42,7 +42,7 @@ Query
  • - Abstract_Util + AbstractUtil
  • __construct
  • @@ -59,18 +59,18 @@ Parameter
  • - Source + Source
  • -

    Query\Abstract_Util::__construct

    +

    Query\AbstractUtil::__construct

    Save a reference to the connection object for later use

      Signature

      - public function __construct(Driver_Interface + public function __construct(DriverInterface $conn )
      diff --git a/docs/classes/Query_Abstract_Util/backup_data.html b/docs/classes/Query_AbstractUtil/backup_data.html similarity index 90% rename from docs/classes/Query_Abstract_Util/backup_data.html rename to docs/classes/Query_AbstractUtil/backup_data.html index f6b3cb9..dfdcdfc 100644 --- a/docs/classes/Query_Abstract_Util/backup_data.html +++ b/docs/classes/Query_AbstractUtil/backup_data.html @@ -42,7 +42,7 @@ Query
    • - Abstract_Util + AbstractUtil
    • backup_data
    @@ -59,12 +59,12 @@ Return
  • - Source + Source
  • -

    Query\Abstract_Util::backup_data

    +

    Query\AbstractUtil::backup_data

    Return an SQL file with the database data as insert statements

      diff --git a/docs/classes/Query_Abstract_Util/backup_structure.html b/docs/classes/Query_AbstractUtil/backup_structure.html similarity index 90% rename from docs/classes/Query_Abstract_Util/backup_structure.html rename to docs/classes/Query_AbstractUtil/backup_structure.html index a983d37..44321e6 100644 --- a/docs/classes/Query_Abstract_Util/backup_structure.html +++ b/docs/classes/Query_AbstractUtil/backup_structure.html @@ -42,7 +42,7 @@ Query
    • - Abstract_Util + AbstractUtil
    • backup_structure
    @@ -59,12 +59,12 @@ Return
  • - Source + Source
  • -

    Query\Abstract_Util::backup_structure

    +

    Query\AbstractUtil::backup_structure

    Return an SQL file with the database table structure

      diff --git a/docs/classes/Query_Abstract_Util/create_table.html b/docs/classes/Query_AbstractUtil/create_table.html similarity index 92% rename from docs/classes/Query_Abstract_Util/create_table.html rename to docs/classes/Query_AbstractUtil/create_table.html index df80010..5b7fcbc 100644 --- a/docs/classes/Query_Abstract_Util/create_table.html +++ b/docs/classes/Query_AbstractUtil/create_table.html @@ -42,7 +42,7 @@ Query
    • - Abstract_Util + AbstractUtil
    • create_table
    @@ -62,12 +62,12 @@ Return
  • - Source + Source
  • -

    Query\Abstract_Util::create_table

    +

    Query\AbstractUtil::create_table

    Convenience public function to generate sql for creating a db table

      diff --git a/docs/classes/Query_Abstract_Util/delete_table.html b/docs/classes/Query_AbstractUtil/delete_table.html similarity index 91% rename from docs/classes/Query_Abstract_Util/delete_table.html rename to docs/classes/Query_AbstractUtil/delete_table.html index 5382bd8..e47c0a3 100644 --- a/docs/classes/Query_Abstract_Util/delete_table.html +++ b/docs/classes/Query_AbstractUtil/delete_table.html @@ -42,7 +42,7 @@ Query
    • - Abstract_Util + AbstractUtil
    • delete_table
    @@ -62,12 +62,12 @@ Return
  • - Source + Source
  • -

    Query\Abstract_Util::delete_table

    +

    Query\AbstractUtil::delete_table

    Drop the selected table

      diff --git a/docs/classes/Query_Abstract_Util/get_driver.html b/docs/classes/Query_AbstractUtil/get_driver.html similarity index 90% rename from docs/classes/Query_Abstract_Util/get_driver.html rename to docs/classes/Query_AbstractUtil/get_driver.html index 235e474..a28a2a9 100644 --- a/docs/classes/Query_Abstract_Util/get_driver.html +++ b/docs/classes/Query_AbstractUtil/get_driver.html @@ -42,7 +42,7 @@ Query
    • - Abstract_Util + AbstractUtil
    • get_driver
    @@ -59,12 +59,12 @@ Return
  • - Source + Source
  • -

    Query\Abstract_Util::get_driver

    +

    Query\AbstractUtil::get_driver

    Get the driver object for the current connection

      diff --git a/docs/classes/Query_Connection_Manager.html b/docs/classes/Query_ConnectionManager.html similarity index 80% rename from docs/classes/Query_Connection_Manager.html rename to docs/classes/Query_ConnectionManager.html index 7e203aa..caa0a04 100644 --- a/docs/classes/Query_Connection_Manager.html +++ b/docs/classes/Query_ConnectionManager.html @@ -2,7 +2,7 @@ - phpDox - Query\Connection_Manager + phpDox - Query\ConnectionManager @@ -41,7 +41,7 @@
    • Query
    • -
    • Connection_Manager
    • +
    • ConnectionManager
    -

    Query\Connection_Manager

    +

    Query\ConnectionManager

    Connection manager class to manage connections for the Query method

      Synopsis

      -
      class Connection_Manager +
      class ConnectionManager {
      }
      @@ -105,31 +105,41 @@

      private

      public

      History

        +
      • +

        2015-11-10T10:12:23-05:00 (commit #b5a141f)

        +
        +

        + Author: Timothy J Warren (tim@timshomepage.net) / + Commiter: Timothy J Warren (tim@timshomepage.net) +

        +
        Make class names Pascal Case
        +
        +
      • 2015-07-30T16:40:30-04:00 (commit #225017a)

        @@ -280,16 +290,6 @@
        Add insert_batch methods to Firebird and SQLite
      • -
      • -

        2014-04-02T18:53:48-04:00 (commit #bccea8c)

        -
        -

        - Author: Timothy J. Warren (tim@timshomepage.net) / - Commiter: Timothy J. Warren (tim@timshomepage.net) -

        -
        A little cleanup of parser and connection code
        -
        -
    diff --git a/docs/classes/Query_Connection_Manager/__clone.html b/docs/classes/Query_ConnectionManager/__clone.html similarity index 90% rename from docs/classes/Query_Connection_Manager/__clone.html rename to docs/classes/Query_ConnectionManager/__clone.html index 0dd2501..c9adc19 100644 --- a/docs/classes/Query_Connection_Manager/__clone.html +++ b/docs/classes/Query_ConnectionManager/__clone.html @@ -42,7 +42,7 @@ Query
  • - Connection_Manager + ConnectionManager
  • __clone
  • @@ -59,12 +59,12 @@ Throws
  • - Source + Source
  • -

    Query\Connection_Manager::__clone

    +

    Query\ConnectionManager::__clone

    Private clone method to prevent cloning

      diff --git a/docs/classes/Query_Connection_Manager/__construct.html b/docs/classes/Query_ConnectionManager/__construct.html similarity index 88% rename from docs/classes/Query_Connection_Manager/__construct.html rename to docs/classes/Query_ConnectionManager/__construct.html index 59d7792..7ab7442 100644 --- a/docs/classes/Query_Connection_Manager/__construct.html +++ b/docs/classes/Query_ConnectionManager/__construct.html @@ -42,7 +42,7 @@ Query
    • - Connection_Manager + ConnectionManager
    • __construct
    @@ -56,12 +56,12 @@ Synopsis
  • - Source + Source
  • -

    Query\Connection_Manager::__construct

    +

    Query\ConnectionManager::__construct

    Private constructor to prevent multiple instances

      diff --git a/docs/classes/Query_Connection_Manager/__sleep.html b/docs/classes/Query_ConnectionManager/__sleep.html similarity index 90% rename from docs/classes/Query_Connection_Manager/__sleep.html rename to docs/classes/Query_ConnectionManager/__sleep.html index f474181..c34b61d 100644 --- a/docs/classes/Query_Connection_Manager/__sleep.html +++ b/docs/classes/Query_ConnectionManager/__sleep.html @@ -42,7 +42,7 @@ Query
    • - Connection_Manager + ConnectionManager
    • __sleep
    @@ -59,12 +59,12 @@ Throws
  • - Source + Source
  • -

    Query\Connection_Manager::__sleep

    +

    Query\ConnectionManager::__sleep

    Prevent serialization of this object

      diff --git a/docs/classes/Query_Connection_Manager/__wakeup.html b/docs/classes/Query_ConnectionManager/__wakeup.html similarity index 90% rename from docs/classes/Query_Connection_Manager/__wakeup.html rename to docs/classes/Query_ConnectionManager/__wakeup.html index ce73aba..a20eda4 100644 --- a/docs/classes/Query_Connection_Manager/__wakeup.html +++ b/docs/classes/Query_ConnectionManager/__wakeup.html @@ -42,7 +42,7 @@ Query
    • - Connection_Manager + ConnectionManager
    • __wakeup
    @@ -59,12 +59,12 @@ Throws
  • - Source + Source
  • -

    Query\Connection_Manager::__wakeup

    +

    Query\ConnectionManager::__wakeup

    Make sure serialize/deserialize doesn't work

      diff --git a/docs/classes/Query_Connection_Manager/connect.html b/docs/classes/Query_ConnectionManager/connect.html similarity index 91% rename from docs/classes/Query_Connection_Manager/connect.html rename to docs/classes/Query_ConnectionManager/connect.html index adb1c98..245bd26 100644 --- a/docs/classes/Query_Connection_Manager/connect.html +++ b/docs/classes/Query_ConnectionManager/connect.html @@ -42,7 +42,7 @@ Query
    • - Connection_Manager + ConnectionManager
    • connect
    @@ -62,12 +62,12 @@ Return
  • - Source + Source
  • -

    Query\Connection_Manager::connect

    +

    Query\ConnectionManager::connect

    Parse the passed parameters and return a connection

      diff --git a/docs/classes/Query_Connection_Manager/create_dsn.html b/docs/classes/Query_ConnectionManager/create_dsn.html similarity index 91% rename from docs/classes/Query_Connection_Manager/create_dsn.html rename to docs/classes/Query_ConnectionManager/create_dsn.html index d245060..3c76808 100644 --- a/docs/classes/Query_Connection_Manager/create_dsn.html +++ b/docs/classes/Query_ConnectionManager/create_dsn.html @@ -42,7 +42,7 @@ Query
    • - Connection_Manager + ConnectionManager
    • create_dsn
    @@ -62,12 +62,12 @@ Return
  • - Source + Source
  • -

    Query\Connection_Manager::create_dsn

    +

    Query\ConnectionManager::create_dsn

    Create the dsn from the db type and params

      diff --git a/docs/classes/Query_Connection_Manager/get_connection.html b/docs/classes/Query_ConnectionManager/get_connection.html similarity index 91% rename from docs/classes/Query_Connection_Manager/get_connection.html rename to docs/classes/Query_ConnectionManager/get_connection.html index 3618abc..5fe0362 100644 --- a/docs/classes/Query_Connection_Manager/get_connection.html +++ b/docs/classes/Query_ConnectionManager/get_connection.html @@ -42,7 +42,7 @@ Query
    • - Connection_Manager + ConnectionManager
    • get_connection
    @@ -65,12 +65,12 @@ Throws
  • - Source + Source
  • -

    Query\Connection_Manager::get_connection

    +

    Query\ConnectionManager::get_connection

    Returns the connection specified by the name given

      diff --git a/docs/classes/Query_Connection_Manager/get_instance.html b/docs/classes/Query_ConnectionManager/get_instance.html similarity index 89% rename from docs/classes/Query_Connection_Manager/get_instance.html rename to docs/classes/Query_ConnectionManager/get_instance.html index da4230e..4b309e2 100644 --- a/docs/classes/Query_Connection_Manager/get_instance.html +++ b/docs/classes/Query_ConnectionManager/get_instance.html @@ -42,7 +42,7 @@ Query
    • - Connection_Manager + ConnectionManager
    • get_instance
    @@ -59,12 +59,12 @@ Return
  • - Source + Source
  • -

    Query\Connection_Manager::get_instance

    +

    Query\ConnectionManager::get_instance

    Return a connection manager instance

      diff --git a/docs/classes/Query_Connection_Manager/parse_params.html b/docs/classes/Query_ConnectionManager/parse_params.html similarity index 91% rename from docs/classes/Query_Connection_Manager/parse_params.html rename to docs/classes/Query_ConnectionManager/parse_params.html index f5292e7..88e216d 100644 --- a/docs/classes/Query_Connection_Manager/parse_params.html +++ b/docs/classes/Query_ConnectionManager/parse_params.html @@ -42,7 +42,7 @@ Query
    • - Connection_Manager + ConnectionManager
    • parse_params
    @@ -65,12 +65,12 @@ Throws
  • - Source + Source
  • -

    Query\Connection_Manager::parse_params

    +

    Query\ConnectionManager::parse_params

    Parses params into a dsn and option array

    diff --git a/docs/classes/Query_Drivers_Firebird_Driver/beginTransaction.html b/docs/classes/Query_Drivers_Firebird_Driver/beginTransaction.html index 9c486e0..c95d7ae 100644 --- a/docs/classes/Query_Drivers_Firebird_Driver/beginTransaction.html +++ b/docs/classes/Query_Drivers_Firebird_Driver/beginTransaction.html @@ -88,7 +88,7 @@

    Defined by Interface

    - Driver_Interface + DriverInterface

    Parent Implementation

    diff --git a/docs/classes/Query_Drivers_Firebird_Driver/commit.html b/docs/classes/Query_Drivers_Firebird_Driver/commit.html index f14bc45..e162cef 100644 --- a/docs/classes/Query_Drivers_Firebird_Driver/commit.html +++ b/docs/classes/Query_Drivers_Firebird_Driver/commit.html @@ -88,7 +88,7 @@

    Defined by Interface

    - Driver_Interface + DriverInterface

    Parent Implementation

    diff --git a/docs/classes/Query_Drivers_Firebird_Driver/errorCode.html b/docs/classes/Query_Drivers_Firebird_Driver/errorCode.html index 9a647d9..e7c2717 100644 --- a/docs/classes/Query_Drivers_Firebird_Driver/errorCode.html +++ b/docs/classes/Query_Drivers_Firebird_Driver/errorCode.html @@ -87,7 +87,7 @@

    Defined by Interface

    - Driver_Interface + DriverInterface

    Parent Implementation

    diff --git a/docs/classes/Query_Drivers_Firebird_Driver/errorInfo.html b/docs/classes/Query_Drivers_Firebird_Driver/errorInfo.html index fb7645f..8c54f1c 100644 --- a/docs/classes/Query_Drivers_Firebird_Driver/errorInfo.html +++ b/docs/classes/Query_Drivers_Firebird_Driver/errorInfo.html @@ -87,7 +87,7 @@

    Defined by Interface

    - Driver_Interface + DriverInterface

    Parent Implementation

    diff --git a/docs/classes/Query_Drivers_Firebird_Driver/exec.html b/docs/classes/Query_Drivers_Firebird_Driver/exec.html index deae5dc..d8edb0b 100644 --- a/docs/classes/Query_Drivers_Firebird_Driver/exec.html +++ b/docs/classes/Query_Drivers_Firebird_Driver/exec.html @@ -98,7 +98,7 @@

    Defined by Interface

    - Driver_Interface + DriverInterface

    Parent Implementation

    diff --git a/docs/classes/Query_Drivers_Firebird_Driver/getAttribute.html b/docs/classes/Query_Drivers_Firebird_Driver/getAttribute.html index 31bace7..cbb24c6 100644 --- a/docs/classes/Query_Drivers_Firebird_Driver/getAttribute.html +++ b/docs/classes/Query_Drivers_Firebird_Driver/getAttribute.html @@ -98,7 +98,7 @@

    Defined by Interface

    - Driver_Interface + DriverInterface

    Parent Implementation

    diff --git a/docs/classes/Query_Drivers_Firebird_Driver/insert_batch.html b/docs/classes/Query_Drivers_Firebird_Driver/insert_batch.html index 4796e2f..e6edff9 100644 --- a/docs/classes/Query_Drivers_Firebird_Driver/insert_batch.html +++ b/docs/classes/Query_Drivers_Firebird_Driver/insert_batch.html @@ -104,14 +104,14 @@

    Defined by Interface

    - Driver_Interface + DriverInterface

    Parent Implementation

    diff --git a/docs/classes/Query_Drivers_Firebird_Driver/prepare_execute.html b/docs/classes/Query_Drivers_Firebird_Driver/prepare_execute.html index 6a72a60..1bdaed4 100644 --- a/docs/classes/Query_Drivers_Firebird_Driver/prepare_execute.html +++ b/docs/classes/Query_Drivers_Firebird_Driver/prepare_execute.html @@ -105,14 +105,14 @@

    Defined by Interface

    - Driver_Interface + DriverInterface

    Parent Implementation

    diff --git a/docs/classes/Query_Drivers_Firebird_Driver/prepare_query.html b/docs/classes/Query_Drivers_Firebird_Driver/prepare_query.html index 3b268fb..63d1dd6 100644 --- a/docs/classes/Query_Drivers_Firebird_Driver/prepare_query.html +++ b/docs/classes/Query_Drivers_Firebird_Driver/prepare_query.html @@ -105,14 +105,14 @@

    Defined by Interface

    - Driver_Interface + DriverInterface

    Parent Implementation

    diff --git a/docs/classes/Query_Drivers_Firebird_Driver/setAttribute.html b/docs/classes/Query_Drivers_Firebird_Driver/setAttribute.html index e4248fe..8aace73 100644 --- a/docs/classes/Query_Drivers_Firebird_Driver/setAttribute.html +++ b/docs/classes/Query_Drivers_Firebird_Driver/setAttribute.html @@ -105,7 +105,7 @@

    Defined by Interface

    - Driver_Interface + DriverInterface

    Parent Implementation

    diff --git a/docs/classes/Query_Drivers_Firebird_SQL.html b/docs/classes/Query_Drivers_Firebird_SQL.html index 678a51c..df20bc7 100644 --- a/docs/classes/Query_Drivers_Firebird_SQL.html +++ b/docs/classes/Query_Drivers_Firebird_SQL.html @@ -73,7 +73,7 @@ -

    Inherited from Query\Abstract_SQL

    +

    Inherited from Query\AbstractSQL

    public

    History

      +
    • +

      2015-11-10T10:12:23-05:00 (commit #b5a141f)

      +
      +

      + Author: Timothy J Warren (tim@timshomepage.net) / + Commiter: Timothy J Warren (tim@timshomepage.net) +

      +
      Make class names Pascal Case
      +
      +
    • 2015-07-29T16:51:17-04:00 (commit #8511c6a)

      @@ -296,16 +306,6 @@
      Update copyright for the new year
    • -
    • -

      2013-05-01T15:59:23-04:00 (commit #40c76b2)

      -
      -

      - Author: Timothy Warren (tim@timshomepage.net) / - Commiter: Timothy Warren (tim@timshomepage.net) -

      -
      Changed invalid methods to return NULL instead of FALSE, added insert_batch
      -
      -
    diff --git a/docs/classes/Query_Drivers_Firebird_SQL/column_list.html b/docs/classes/Query_Drivers_Firebird_SQL/column_list.html index 673f6c4..f6c39eb 100644 --- a/docs/classes/Query_Drivers_Firebird_SQL/column_list.html +++ b/docs/classes/Query_Drivers_Firebird_SQL/column_list.html @@ -95,7 +95,7 @@

    Defined by Interface

    - SQL_Interface + SQLInterface

    diff --git a/docs/classes/Query_Drivers_Firebird_SQL/db_list.html b/docs/classes/Query_Drivers_Firebird_SQL/db_list.html index 269c8d2..deafcdc 100644 --- a/docs/classes/Query_Drivers_Firebird_SQL/db_list.html +++ b/docs/classes/Query_Drivers_Firebird_SQL/db_list.html @@ -85,7 +85,7 @@

    Defined by Interface

    - SQL_Interface + SQLInterface

    diff --git a/docs/classes/Query_Drivers_Firebird_SQL/explain.html b/docs/classes/Query_Drivers_Firebird_SQL/explain.html index e273a0e..a1015ef 100644 --- a/docs/classes/Query_Drivers_Firebird_SQL/explain.html +++ b/docs/classes/Query_Drivers_Firebird_SQL/explain.html @@ -95,7 +95,7 @@

    Defined by Interface

    - SQL_Interface + SQLInterface

    diff --git a/docs/classes/Query_Drivers_Firebird_SQL/fk_list.html b/docs/classes/Query_Drivers_Firebird_SQL/fk_list.html index 8c8b101..f7d812b 100644 --- a/docs/classes/Query_Drivers_Firebird_SQL/fk_list.html +++ b/docs/classes/Query_Drivers_Firebird_SQL/fk_list.html @@ -95,7 +95,7 @@

    Defined by Interface

    - SQL_Interface + SQLInterface

    diff --git a/docs/classes/Query_Drivers_Firebird_SQL/function_list.html b/docs/classes/Query_Drivers_Firebird_SQL/function_list.html index 98abce2..a69ad64 100644 --- a/docs/classes/Query_Drivers_Firebird_SQL/function_list.html +++ b/docs/classes/Query_Drivers_Firebird_SQL/function_list.html @@ -84,7 +84,7 @@

    Defined by Interface

    - SQL_Interface + SQLInterface

    diff --git a/docs/classes/Query_Drivers_Firebird_SQL/index_list.html b/docs/classes/Query_Drivers_Firebird_SQL/index_list.html index c03ff1a..6e61fcf 100644 --- a/docs/classes/Query_Drivers_Firebird_SQL/index_list.html +++ b/docs/classes/Query_Drivers_Firebird_SQL/index_list.html @@ -95,7 +95,7 @@

    Defined by Interface

    - SQL_Interface + SQLInterface

    diff --git a/docs/classes/Query_Drivers_Firebird_SQL/limit.html b/docs/classes/Query_Drivers_Firebird_SQL/limit.html index 0d19e76..1309118 100644 --- a/docs/classes/Query_Drivers_Firebird_SQL/limit.html +++ b/docs/classes/Query_Drivers_Firebird_SQL/limit.html @@ -110,14 +110,14 @@

    Defined by Interface

    - SQL_Interface + SQLInterface

    Parent Implementation

    diff --git a/docs/classes/Query_Drivers_Firebird_SQL/procedure_list.html b/docs/classes/Query_Drivers_Firebird_SQL/procedure_list.html index 512323d..d38d816 100644 --- a/docs/classes/Query_Drivers_Firebird_SQL/procedure_list.html +++ b/docs/classes/Query_Drivers_Firebird_SQL/procedure_list.html @@ -84,7 +84,7 @@

    Defined by Interface

    - SQL_Interface + SQLInterface

    diff --git a/docs/classes/Query_Drivers_Firebird_SQL/random.html b/docs/classes/Query_Drivers_Firebird_SQL/random.html index d745829..7512e04 100644 --- a/docs/classes/Query_Drivers_Firebird_SQL/random.html +++ b/docs/classes/Query_Drivers_Firebird_SQL/random.html @@ -84,7 +84,7 @@

    Defined by Interface

    - SQL_Interface + SQLInterface

    diff --git a/docs/classes/Query_Drivers_Firebird_SQL/sequence_list.html b/docs/classes/Query_Drivers_Firebird_SQL/sequence_list.html index bf986e6..695bd86 100644 --- a/docs/classes/Query_Drivers_Firebird_SQL/sequence_list.html +++ b/docs/classes/Query_Drivers_Firebird_SQL/sequence_list.html @@ -84,7 +84,7 @@

    Defined by Interface

    - SQL_Interface + SQLInterface

    diff --git a/docs/classes/Query_Drivers_Firebird_SQL/system_table_list.html b/docs/classes/Query_Drivers_Firebird_SQL/system_table_list.html index c8656ef..d7f7cc0 100644 --- a/docs/classes/Query_Drivers_Firebird_SQL/system_table_list.html +++ b/docs/classes/Query_Drivers_Firebird_SQL/system_table_list.html @@ -84,7 +84,7 @@

    Defined by Interface

    - SQL_Interface + SQLInterface

    diff --git a/docs/classes/Query_Drivers_Firebird_SQL/table_list.html b/docs/classes/Query_Drivers_Firebird_SQL/table_list.html index af05fc3..cad3368 100644 --- a/docs/classes/Query_Drivers_Firebird_SQL/table_list.html +++ b/docs/classes/Query_Drivers_Firebird_SQL/table_list.html @@ -84,7 +84,7 @@

    Defined by Interface

    - SQL_Interface + SQLInterface

    diff --git a/docs/classes/Query_Drivers_Firebird_SQL/trigger_list.html b/docs/classes/Query_Drivers_Firebird_SQL/trigger_list.html index f055875..0042485 100644 --- a/docs/classes/Query_Drivers_Firebird_SQL/trigger_list.html +++ b/docs/classes/Query_Drivers_Firebird_SQL/trigger_list.html @@ -84,7 +84,7 @@

    Defined by Interface

    - SQL_Interface + SQLInterface

    diff --git a/docs/classes/Query_Drivers_Firebird_SQL/type_list.html b/docs/classes/Query_Drivers_Firebird_SQL/type_list.html index 3f6d65a..29a789b 100644 --- a/docs/classes/Query_Drivers_Firebird_SQL/type_list.html +++ b/docs/classes/Query_Drivers_Firebird_SQL/type_list.html @@ -84,7 +84,7 @@

    Defined by Interface

    - SQL_Interface + SQLInterface

    diff --git a/docs/classes/Query_Drivers_Firebird_SQL/view_list.html b/docs/classes/Query_Drivers_Firebird_SQL/view_list.html index 155348d..da26098 100644 --- a/docs/classes/Query_Drivers_Firebird_SQL/view_list.html +++ b/docs/classes/Query_Drivers_Firebird_SQL/view_list.html @@ -84,7 +84,7 @@

    Defined by Interface

    - SQL_Interface + SQLInterface

    diff --git a/docs/classes/Query_Drivers_Firebird_Util.html b/docs/classes/Query_Drivers_Firebird_Util.html index 0525e7a..56c4147 100644 --- a/docs/classes/Query_Drivers_Firebird_Util.html +++ b/docs/classes/Query_Drivers_Firebird_Util.html @@ -73,17 +73,17 @@ -

    Inherited from Query\Abstract_Util

    +

    Inherited from Query\AbstractUtil

    public

    History

      +
    • +

      2015-11-10T10:12:23-05:00 (commit #b5a141f)

      +
      +

      + Author: Timothy J Warren (tim@timshomepage.net) / + Commiter: Timothy J Warren (tim@timshomepage.net) +

      +
      Make class names Pascal Case
      +
      +
    • 2015-07-30T16:40:30-04:00 (commit #225017a)

      @@ -276,16 +286,6 @@
      Rename db_util to abstract_util, mark create_table method as deprecated
    • -
    • -

      2014-04-02T17:08:50-04:00 (commit #e3fdad5)

      -
      -

      - Author: Timothy J. Warren (tim@timshomepage.net) / - Commiter: Timothy J. Warren (tim@timshomepage.net) -

      -
      Namespaces!
      -
      -
    diff --git a/docs/classes/Query_Drivers_Firebird_Util/backup_data.html b/docs/classes/Query_Drivers_Firebird_Util/backup_data.html index fe6097a..bfc51bc 100644 --- a/docs/classes/Query_Drivers_Firebird_Util/backup_data.html +++ b/docs/classes/Query_Drivers_Firebird_Util/backup_data.html @@ -102,7 +102,7 @@ diff --git a/docs/classes/Query_Drivers_Firebird_Util/backup_structure.html b/docs/classes/Query_Drivers_Firebird_Util/backup_structure.html index 9f06cf6..25c396f 100644 --- a/docs/classes/Query_Drivers_Firebird_Util/backup_structure.html +++ b/docs/classes/Query_Drivers_Firebird_Util/backup_structure.html @@ -85,7 +85,7 @@ diff --git a/docs/classes/Query_Drivers_Firebird_Util/create_table.html b/docs/classes/Query_Drivers_Firebird_Util/create_table.html index 81cd90d..519c923 100644 --- a/docs/classes/Query_Drivers_Firebird_Util/create_table.html +++ b/docs/classes/Query_Drivers_Firebird_Util/create_table.html @@ -114,7 +114,7 @@ diff --git a/docs/classes/Query_Drivers_Firebird_Util/delete_table.html b/docs/classes/Query_Drivers_Firebird_Util/delete_table.html index f7e2611..d34d6ec 100644 --- a/docs/classes/Query_Drivers_Firebird_Util/delete_table.html +++ b/docs/classes/Query_Drivers_Firebird_Util/delete_table.html @@ -96,7 +96,7 @@ diff --git a/docs/classes/Query_Drivers_Mysql_Driver.html b/docs/classes/Query_Drivers_Mysql_Driver.html index f746b7f..d658f89 100644 --- a/docs/classes/Query_Drivers_Mysql_Driver.html +++ b/docs/classes/Query_Drivers_Mysql_Driver.html @@ -76,10 +76,10 @@
    diff --git a/docs/classes/Query_Drivers_Mysql_SQL.html b/docs/classes/Query_Drivers_Mysql_SQL.html index a900a37..04aac3d 100644 --- a/docs/classes/Query_Drivers_Mysql_SQL.html +++ b/docs/classes/Query_Drivers_Mysql_SQL.html @@ -73,7 +73,7 @@ -

    Inherited from Query\Abstract_SQL

    +

    Inherited from Query\AbstractSQL

    public

    History

      +
    • +

      2015-11-10T10:12:23-05:00 (commit #b5a141f)

      +
      +

      + Author: Timothy J Warren (tim@timshomepage.net) / + Commiter: Timothy J Warren (tim@timshomepage.net) +

      +
      Make class names Pascal Case
      +
      +
    • 2015-07-29T16:51:17-04:00 (commit #8511c6a)

      @@ -296,16 +306,6 @@
      Changed invalid methods to return NULL instead of FALSE, added insert_batch
    • -
    • -

      2013-01-02T14:26:42-05:00 (commit #0e44bba)

      -
      -

      - Author: Timothy Warren (tim@timshomepage.net) / - Commiter: Timothy Warren (tim@timshomepage.net) -

      -
      Update year
      -
      -
    diff --git a/docs/classes/Query_Drivers_Mysql_SQL/column_list.html b/docs/classes/Query_Drivers_Mysql_SQL/column_list.html index 8ceed0e..58a7443 100644 --- a/docs/classes/Query_Drivers_Mysql_SQL/column_list.html +++ b/docs/classes/Query_Drivers_Mysql_SQL/column_list.html @@ -95,7 +95,7 @@

    Defined by Interface

    - SQL_Interface + SQLInterface

    diff --git a/docs/classes/Query_Drivers_Mysql_SQL/db_list.html b/docs/classes/Query_Drivers_Mysql_SQL/db_list.html index 57bf7f2..b6a6f37 100644 --- a/docs/classes/Query_Drivers_Mysql_SQL/db_list.html +++ b/docs/classes/Query_Drivers_Mysql_SQL/db_list.html @@ -84,7 +84,7 @@

    Defined by Interface

    - SQL_Interface + SQLInterface

    diff --git a/docs/classes/Query_Drivers_Mysql_SQL/explain.html b/docs/classes/Query_Drivers_Mysql_SQL/explain.html index ef093ed..4482f75 100644 --- a/docs/classes/Query_Drivers_Mysql_SQL/explain.html +++ b/docs/classes/Query_Drivers_Mysql_SQL/explain.html @@ -95,7 +95,7 @@

    Defined by Interface

    - SQL_Interface + SQLInterface

    diff --git a/docs/classes/Query_Drivers_Mysql_SQL/fk_list.html b/docs/classes/Query_Drivers_Mysql_SQL/fk_list.html index 44c6c22..f6f49dd 100644 --- a/docs/classes/Query_Drivers_Mysql_SQL/fk_list.html +++ b/docs/classes/Query_Drivers_Mysql_SQL/fk_list.html @@ -95,7 +95,7 @@

    Defined by Interface

    - SQL_Interface + SQLInterface

    diff --git a/docs/classes/Query_Drivers_Mysql_SQL/function_list.html b/docs/classes/Query_Drivers_Mysql_SQL/function_list.html index 991b321..9381b30 100644 --- a/docs/classes/Query_Drivers_Mysql_SQL/function_list.html +++ b/docs/classes/Query_Drivers_Mysql_SQL/function_list.html @@ -84,7 +84,7 @@

    Defined by Interface

    - SQL_Interface + SQLInterface

    diff --git a/docs/classes/Query_Drivers_Mysql_SQL/index_list.html b/docs/classes/Query_Drivers_Mysql_SQL/index_list.html index 2122b87..c304eb1 100644 --- a/docs/classes/Query_Drivers_Mysql_SQL/index_list.html +++ b/docs/classes/Query_Drivers_Mysql_SQL/index_list.html @@ -95,7 +95,7 @@

    Defined by Interface

    - SQL_Interface + SQLInterface

    diff --git a/docs/classes/Query_Drivers_Mysql_SQL/limit.html b/docs/classes/Query_Drivers_Mysql_SQL/limit.html index 44127bf..661ce89 100644 --- a/docs/classes/Query_Drivers_Mysql_SQL/limit.html +++ b/docs/classes/Query_Drivers_Mysql_SQL/limit.html @@ -110,14 +110,14 @@

    Defined by Interface

    - SQL_Interface + SQLInterface

    Parent Implementation

    diff --git a/docs/classes/Query_Drivers_Mysql_SQL/procedure_list.html b/docs/classes/Query_Drivers_Mysql_SQL/procedure_list.html index 2762311..eb510aa 100644 --- a/docs/classes/Query_Drivers_Mysql_SQL/procedure_list.html +++ b/docs/classes/Query_Drivers_Mysql_SQL/procedure_list.html @@ -84,7 +84,7 @@

    Defined by Interface

    - SQL_Interface + SQLInterface

    diff --git a/docs/classes/Query_Drivers_Mysql_SQL/random.html b/docs/classes/Query_Drivers_Mysql_SQL/random.html index 0a2cbaf..0188629 100644 --- a/docs/classes/Query_Drivers_Mysql_SQL/random.html +++ b/docs/classes/Query_Drivers_Mysql_SQL/random.html @@ -84,7 +84,7 @@

    Defined by Interface

    - SQL_Interface + SQLInterface

    diff --git a/docs/classes/Query_Drivers_Mysql_SQL/sequence_list.html b/docs/classes/Query_Drivers_Mysql_SQL/sequence_list.html index 231f905..739fae0 100644 --- a/docs/classes/Query_Drivers_Mysql_SQL/sequence_list.html +++ b/docs/classes/Query_Drivers_Mysql_SQL/sequence_list.html @@ -85,7 +85,7 @@

    Defined by Interface

    - SQL_Interface + SQLInterface

    diff --git a/docs/classes/Query_Drivers_Mysql_SQL/system_table_list.html b/docs/classes/Query_Drivers_Mysql_SQL/system_table_list.html index f729bf0..2cf0cbd 100644 --- a/docs/classes/Query_Drivers_Mysql_SQL/system_table_list.html +++ b/docs/classes/Query_Drivers_Mysql_SQL/system_table_list.html @@ -84,7 +84,7 @@

    Defined by Interface

    - SQL_Interface + SQLInterface

    diff --git a/docs/classes/Query_Drivers_Mysql_SQL/table_list.html b/docs/classes/Query_Drivers_Mysql_SQL/table_list.html index f18ca54..d5482c2 100644 --- a/docs/classes/Query_Drivers_Mysql_SQL/table_list.html +++ b/docs/classes/Query_Drivers_Mysql_SQL/table_list.html @@ -95,7 +95,7 @@

    Defined by Interface

    - SQL_Interface + SQLInterface

    diff --git a/docs/classes/Query_Drivers_Mysql_SQL/trigger_list.html b/docs/classes/Query_Drivers_Mysql_SQL/trigger_list.html index 66ab763..81292e5 100644 --- a/docs/classes/Query_Drivers_Mysql_SQL/trigger_list.html +++ b/docs/classes/Query_Drivers_Mysql_SQL/trigger_list.html @@ -84,7 +84,7 @@

    Defined by Interface

    - SQL_Interface + SQLInterface

    diff --git a/docs/classes/Query_Drivers_Mysql_SQL/type_list.html b/docs/classes/Query_Drivers_Mysql_SQL/type_list.html index cb84761..656b7f7 100644 --- a/docs/classes/Query_Drivers_Mysql_SQL/type_list.html +++ b/docs/classes/Query_Drivers_Mysql_SQL/type_list.html @@ -84,7 +84,7 @@

    Defined by Interface

    - SQL_Interface + SQLInterface

    diff --git a/docs/classes/Query_Drivers_Mysql_SQL/view_list.html b/docs/classes/Query_Drivers_Mysql_SQL/view_list.html index 888bbf0..d19d8ea 100644 --- a/docs/classes/Query_Drivers_Mysql_SQL/view_list.html +++ b/docs/classes/Query_Drivers_Mysql_SQL/view_list.html @@ -84,7 +84,7 @@

    Defined by Interface

    - SQL_Interface + SQLInterface

    diff --git a/docs/classes/Query_Drivers_Mysql_Util.html b/docs/classes/Query_Drivers_Mysql_Util.html index 5c1db31..4531092 100644 --- a/docs/classes/Query_Drivers_Mysql_Util.html +++ b/docs/classes/Query_Drivers_Mysql_Util.html @@ -73,15 +73,15 @@ -

    Inherited from Query\Abstract_Util

    +

    Inherited from Query\AbstractUtil

    public

    History

      +
    • +

      2015-11-10T10:12:23-05:00 (commit #b5a141f)

      +
      +

      + Author: Timothy J Warren (tim@timshomepage.net) / + Commiter: Timothy J Warren (tim@timshomepage.net) +

      +
      Make class names Pascal Case
      +
      +
    • 2015-07-29T16:51:17-04:00 (commit #8511c6a)

      @@ -270,16 +280,6 @@
      Fix some docblocks, and update test files to 2014
    • -
    • -

      2014-01-02T12:36:50-05:00 (commit #6dc9ed0)

      -
      -

      - Author: Timothy J. Warren (tim@timshomepage.net) / - Commiter: Timothy J. Warren (tim@timshomepage.net) -

      -
      Update copyright for the new year
      -
      -
    diff --git a/docs/classes/Query_Drivers_Mysql_Util/backup_data.html b/docs/classes/Query_Drivers_Mysql_Util/backup_data.html index 89dfaf7..562bc74 100644 --- a/docs/classes/Query_Drivers_Mysql_Util/backup_data.html +++ b/docs/classes/Query_Drivers_Mysql_Util/backup_data.html @@ -96,7 +96,7 @@ diff --git a/docs/classes/Query_Drivers_Mysql_Util/backup_structure.html b/docs/classes/Query_Drivers_Mysql_Util/backup_structure.html index 2d04b58..47545e7 100644 --- a/docs/classes/Query_Drivers_Mysql_Util/backup_structure.html +++ b/docs/classes/Query_Drivers_Mysql_Util/backup_structure.html @@ -85,7 +85,7 @@ diff --git a/docs/classes/Query_Drivers_Pgsql_Driver.html b/docs/classes/Query_Drivers_Pgsql_Driver.html index 4f093a4..b8afa78 100644 --- a/docs/classes/Query_Drivers_Pgsql_Driver.html +++ b/docs/classes/Query_Drivers_Pgsql_Driver.html @@ -76,8 +76,8 @@ -

    Inherited from Query\Abstract_Driver

    +

    Inherited from Query\AbstractDriver

    protected

    public

    Inherited from PDO

    @@ -319,6 +319,16 @@

    History

      +
    • +

      2015-11-10T10:12:23-05:00 (commit #b5a141f)

      +
      +

      + Author: Timothy J Warren (tim@timshomepage.net) / + Commiter: Timothy J Warren (tim@timshomepage.net) +

      +
      Make class names Pascal Case
      +
      +
    • 2015-07-30T16:40:30-04:00 (commit #225017a)

      @@ -469,16 +479,6 @@
      Add list_types abstract method to db_sql class
    • -
    • -

      2012-04-23T13:28:49-04:00 (commit #1849e2d)

      -
      -

      - Author: Timothy Warren (tim@timshomepage.net) / - Commiter: Timothy Warren (tim@timshomepage.net) -

      -
      Misc tweaks
      -
      -
    diff --git a/docs/classes/Query_Drivers_Pgsql_Driver/get_fks.html b/docs/classes/Query_Drivers_Pgsql_Driver/get_fks.html index 0c115d3..4e44609 100644 --- a/docs/classes/Query_Drivers_Pgsql_Driver/get_fks.html +++ b/docs/classes/Query_Drivers_Pgsql_Driver/get_fks.html @@ -98,14 +98,14 @@

    Defined by Interface

    - Driver_Interface + DriverInterface

    Parent Implementation

    diff --git a/docs/classes/Query_Drivers_Pgsql_Driver/get_schemas.html b/docs/classes/Query_Drivers_Pgsql_Driver/get_schemas.html index ccc6537..95672f4 100644 --- a/docs/classes/Query_Drivers_Pgsql_Driver/get_schemas.html +++ b/docs/classes/Query_Drivers_Pgsql_Driver/get_schemas.html @@ -85,7 +85,7 @@ diff --git a/docs/classes/Query_Drivers_Pgsql_SQL.html b/docs/classes/Query_Drivers_Pgsql_SQL.html index 5d759a0..088840e 100644 --- a/docs/classes/Query_Drivers_Pgsql_SQL.html +++ b/docs/classes/Query_Drivers_Pgsql_SQL.html @@ -73,7 +73,7 @@ -

    Inherited from Query\Abstract_SQL

    +

    Inherited from Query\AbstractSQL

    public

    History

      +
    • +

      2015-11-10T10:12:23-05:00 (commit #b5a141f)

      +
      +

      + Author: Timothy J Warren (tim@timshomepage.net) / + Commiter: Timothy J Warren (tim@timshomepage.net) +

      +
      Make class names Pascal Case
      +
      +
    • 2015-07-30T16:40:30-04:00 (commit #225017a)

      @@ -293,16 +303,6 @@
      Changed invalid methods to return NULL instead of FALSE, added insert_batch
    • -
    • -

      2013-01-02T14:26:42-05:00 (commit #0e44bba)

      -
      -

      - Author: Timothy Warren (tim@timshomepage.net) / - Commiter: Timothy Warren (tim@timshomepage.net) -

      -
      Update year
      -
      -
    diff --git a/docs/classes/Query_Drivers_Pgsql_SQL/column_list.html b/docs/classes/Query_Drivers_Pgsql_SQL/column_list.html index 002d9f3..033ca52 100644 --- a/docs/classes/Query_Drivers_Pgsql_SQL/column_list.html +++ b/docs/classes/Query_Drivers_Pgsql_SQL/column_list.html @@ -95,7 +95,7 @@

    Defined by Interface

    - SQL_Interface + SQLInterface

    diff --git a/docs/classes/Query_Drivers_Pgsql_SQL/db_list.html b/docs/classes/Query_Drivers_Pgsql_SQL/db_list.html index 3d4fee1..3b69907 100644 --- a/docs/classes/Query_Drivers_Pgsql_SQL/db_list.html +++ b/docs/classes/Query_Drivers_Pgsql_SQL/db_list.html @@ -84,7 +84,7 @@

    Defined by Interface

    - SQL_Interface + SQLInterface

    diff --git a/docs/classes/Query_Drivers_Pgsql_SQL/explain.html b/docs/classes/Query_Drivers_Pgsql_SQL/explain.html index ed1b527..3bc8a72 100644 --- a/docs/classes/Query_Drivers_Pgsql_SQL/explain.html +++ b/docs/classes/Query_Drivers_Pgsql_SQL/explain.html @@ -95,7 +95,7 @@

    Defined by Interface

    - SQL_Interface + SQLInterface

    diff --git a/docs/classes/Query_Drivers_Pgsql_SQL/fk_list.html b/docs/classes/Query_Drivers_Pgsql_SQL/fk_list.html index b8c977d..bbc1c42 100644 --- a/docs/classes/Query_Drivers_Pgsql_SQL/fk_list.html +++ b/docs/classes/Query_Drivers_Pgsql_SQL/fk_list.html @@ -95,7 +95,7 @@

    Defined by Interface

    - SQL_Interface + SQLInterface

    diff --git a/docs/classes/Query_Drivers_Pgsql_SQL/function_list.html b/docs/classes/Query_Drivers_Pgsql_SQL/function_list.html index 19c4ccb..20bfd0e 100644 --- a/docs/classes/Query_Drivers_Pgsql_SQL/function_list.html +++ b/docs/classes/Query_Drivers_Pgsql_SQL/function_list.html @@ -85,7 +85,7 @@

    Defined by Interface

    - SQL_Interface + SQLInterface

    diff --git a/docs/classes/Query_Drivers_Pgsql_SQL/index_list.html b/docs/classes/Query_Drivers_Pgsql_SQL/index_list.html index c75da56..8fbde86 100644 --- a/docs/classes/Query_Drivers_Pgsql_SQL/index_list.html +++ b/docs/classes/Query_Drivers_Pgsql_SQL/index_list.html @@ -95,7 +95,7 @@

    Defined by Interface

    - SQL_Interface + SQLInterface

    diff --git a/docs/classes/Query_Drivers_Pgsql_SQL/procedure_list.html b/docs/classes/Query_Drivers_Pgsql_SQL/procedure_list.html index 9ff9e71..416a836 100644 --- a/docs/classes/Query_Drivers_Pgsql_SQL/procedure_list.html +++ b/docs/classes/Query_Drivers_Pgsql_SQL/procedure_list.html @@ -84,7 +84,7 @@

    Defined by Interface

    - SQL_Interface + SQLInterface

    diff --git a/docs/classes/Query_Drivers_Pgsql_SQL/random.html b/docs/classes/Query_Drivers_Pgsql_SQL/random.html index e7b468a..46a04ca 100644 --- a/docs/classes/Query_Drivers_Pgsql_SQL/random.html +++ b/docs/classes/Query_Drivers_Pgsql_SQL/random.html @@ -84,7 +84,7 @@

    Defined by Interface

    - SQL_Interface + SQLInterface

    diff --git a/docs/classes/Query_Drivers_Pgsql_SQL/sequence_list.html b/docs/classes/Query_Drivers_Pgsql_SQL/sequence_list.html index 04ccfdb..e367a7a 100644 --- a/docs/classes/Query_Drivers_Pgsql_SQL/sequence_list.html +++ b/docs/classes/Query_Drivers_Pgsql_SQL/sequence_list.html @@ -84,7 +84,7 @@

    Defined by Interface

    - SQL_Interface + SQLInterface

    diff --git a/docs/classes/Query_Drivers_Pgsql_SQL/system_table_list.html b/docs/classes/Query_Drivers_Pgsql_SQL/system_table_list.html index ef9c6de..5d2fa05 100644 --- a/docs/classes/Query_Drivers_Pgsql_SQL/system_table_list.html +++ b/docs/classes/Query_Drivers_Pgsql_SQL/system_table_list.html @@ -84,7 +84,7 @@

    Defined by Interface

    - SQL_Interface + SQLInterface

    diff --git a/docs/classes/Query_Drivers_Pgsql_SQL/table_list.html b/docs/classes/Query_Drivers_Pgsql_SQL/table_list.html index 472432c..8e3649d 100644 --- a/docs/classes/Query_Drivers_Pgsql_SQL/table_list.html +++ b/docs/classes/Query_Drivers_Pgsql_SQL/table_list.html @@ -84,7 +84,7 @@

    Defined by Interface

    - SQL_Interface + SQLInterface

    diff --git a/docs/classes/Query_Drivers_Pgsql_SQL/trigger_list.html b/docs/classes/Query_Drivers_Pgsql_SQL/trigger_list.html index f0b2e09..f9b6a32 100644 --- a/docs/classes/Query_Drivers_Pgsql_SQL/trigger_list.html +++ b/docs/classes/Query_Drivers_Pgsql_SQL/trigger_list.html @@ -84,7 +84,7 @@

    Defined by Interface

    - SQL_Interface + SQLInterface

    diff --git a/docs/classes/Query_Drivers_Pgsql_SQL/type_list.html b/docs/classes/Query_Drivers_Pgsql_SQL/type_list.html index ef32bfb..8fa66b3 100644 --- a/docs/classes/Query_Drivers_Pgsql_SQL/type_list.html +++ b/docs/classes/Query_Drivers_Pgsql_SQL/type_list.html @@ -84,7 +84,7 @@

    Defined by Interface

    - SQL_Interface + SQLInterface

    diff --git a/docs/classes/Query_Drivers_Pgsql_SQL/view_list.html b/docs/classes/Query_Drivers_Pgsql_SQL/view_list.html index 5c77fc9..6e06b97 100644 --- a/docs/classes/Query_Drivers_Pgsql_SQL/view_list.html +++ b/docs/classes/Query_Drivers_Pgsql_SQL/view_list.html @@ -84,7 +84,7 @@

    Defined by Interface

    - SQL_Interface + SQLInterface

    diff --git a/docs/classes/Query_Drivers_Pgsql_Util.html b/docs/classes/Query_Drivers_Pgsql_Util.html index fac67d6..570e5b8 100644 --- a/docs/classes/Query_Drivers_Pgsql_Util.html +++ b/docs/classes/Query_Drivers_Pgsql_Util.html @@ -76,15 +76,15 @@ -

    Inherited from Query\Abstract_Util

    +

    Inherited from Query\AbstractUtil

    public

    History

    diff --git a/docs/classes/Query_Drivers_Pgsql_Util/backup_data.html b/docs/classes/Query_Drivers_Pgsql_Util/backup_data.html index 0a0a5be..3dbb863 100644 --- a/docs/classes/Query_Drivers_Pgsql_Util/backup_data.html +++ b/docs/classes/Query_Drivers_Pgsql_Util/backup_data.html @@ -96,7 +96,7 @@ diff --git a/docs/classes/Query_Drivers_Pgsql_Util/backup_structure.html b/docs/classes/Query_Drivers_Pgsql_Util/backup_structure.html index e54119a..65fedf6 100644 --- a/docs/classes/Query_Drivers_Pgsql_Util/backup_structure.html +++ b/docs/classes/Query_Drivers_Pgsql_Util/backup_structure.html @@ -88,7 +88,7 @@ diff --git a/docs/classes/Query_Drivers_Sqlite_Driver.html b/docs/classes/Query_Drivers_Sqlite_Driver.html index 7617db1..a4c44f0 100644 --- a/docs/classes/Query_Drivers_Sqlite_Driver.html +++ b/docs/classes/Query_Drivers_Sqlite_Driver.html @@ -76,11 +76,11 @@ -

    Inherited from Query\Abstract_Driver

    +

    Inherited from Query\AbstractDriver

    protected

    public

    Inherited from PDO

    @@ -331,6 +331,16 @@

    History

    diff --git a/docs/classes/Query_Drivers_Sqlite_Driver/get_fks.html b/docs/classes/Query_Drivers_Sqlite_Driver/get_fks.html index 1207f0b..5a7e662 100644 --- a/docs/classes/Query_Drivers_Sqlite_Driver/get_fks.html +++ b/docs/classes/Query_Drivers_Sqlite_Driver/get_fks.html @@ -98,14 +98,14 @@

    Defined by Interface

    - Driver_Interface + DriverInterface

    Parent Implementation

    diff --git a/docs/classes/Query_Drivers_Sqlite_Driver/get_tables.html b/docs/classes/Query_Drivers_Sqlite_Driver/get_tables.html index 8909343..c8b4d5d 100644 --- a/docs/classes/Query_Drivers_Sqlite_Driver/get_tables.html +++ b/docs/classes/Query_Drivers_Sqlite_Driver/get_tables.html @@ -87,14 +87,14 @@

    Defined by Interface

    - Driver_Interface + DriverInterface

    Parent Implementation

    diff --git a/docs/classes/Query_Drivers_Sqlite_Driver/insert_batch.html b/docs/classes/Query_Drivers_Sqlite_Driver/insert_batch.html index af464bd..361683a 100644 --- a/docs/classes/Query_Drivers_Sqlite_Driver/insert_batch.html +++ b/docs/classes/Query_Drivers_Sqlite_Driver/insert_batch.html @@ -104,14 +104,14 @@

    Defined by Interface

    - Driver_Interface + DriverInterface

    Parent Implementation

    diff --git a/docs/classes/Query_Drivers_Sqlite_SQL.html b/docs/classes/Query_Drivers_Sqlite_SQL.html index d4fbb36..988fa00 100644 --- a/docs/classes/Query_Drivers_Sqlite_SQL.html +++ b/docs/classes/Query_Drivers_Sqlite_SQL.html @@ -73,7 +73,7 @@ -

    Inherited from Query\Abstract_SQL

    +

    Inherited from Query\AbstractSQL

    public

    History

    diff --git a/docs/classes/Query_Drivers_Sqlite_SQL/column_list.html b/docs/classes/Query_Drivers_Sqlite_SQL/column_list.html index 35a1e01..03825fe 100644 --- a/docs/classes/Query_Drivers_Sqlite_SQL/column_list.html +++ b/docs/classes/Query_Drivers_Sqlite_SQL/column_list.html @@ -95,7 +95,7 @@

    Defined by Interface

    - SQL_Interface + SQLInterface

    diff --git a/docs/classes/Query_Drivers_Sqlite_SQL/db_list.html b/docs/classes/Query_Drivers_Sqlite_SQL/db_list.html index bde1d29..72ee782 100644 --- a/docs/classes/Query_Drivers_Sqlite_SQL/db_list.html +++ b/docs/classes/Query_Drivers_Sqlite_SQL/db_list.html @@ -84,7 +84,7 @@

    Defined by Interface

    - SQL_Interface + SQLInterface

    diff --git a/docs/classes/Query_Drivers_Sqlite_SQL/explain.html b/docs/classes/Query_Drivers_Sqlite_SQL/explain.html index 03de8e7..2f14a94 100644 --- a/docs/classes/Query_Drivers_Sqlite_SQL/explain.html +++ b/docs/classes/Query_Drivers_Sqlite_SQL/explain.html @@ -95,7 +95,7 @@

    Defined by Interface

    - SQL_Interface + SQLInterface

    diff --git a/docs/classes/Query_Drivers_Sqlite_SQL/fk_list.html b/docs/classes/Query_Drivers_Sqlite_SQL/fk_list.html index 3ea0d3b..f661828 100644 --- a/docs/classes/Query_Drivers_Sqlite_SQL/fk_list.html +++ b/docs/classes/Query_Drivers_Sqlite_SQL/fk_list.html @@ -95,7 +95,7 @@

    Defined by Interface

    - SQL_Interface + SQLInterface

    diff --git a/docs/classes/Query_Drivers_Sqlite_SQL/function_list.html b/docs/classes/Query_Drivers_Sqlite_SQL/function_list.html index c1ee998..3e61b98 100644 --- a/docs/classes/Query_Drivers_Sqlite_SQL/function_list.html +++ b/docs/classes/Query_Drivers_Sqlite_SQL/function_list.html @@ -85,7 +85,7 @@

    Defined by Interface

    - SQL_Interface + SQLInterface

    diff --git a/docs/classes/Query_Drivers_Sqlite_SQL/index_list.html b/docs/classes/Query_Drivers_Sqlite_SQL/index_list.html index ea9906d..14b7dd6 100644 --- a/docs/classes/Query_Drivers_Sqlite_SQL/index_list.html +++ b/docs/classes/Query_Drivers_Sqlite_SQL/index_list.html @@ -95,7 +95,7 @@

    Defined by Interface

    - SQL_Interface + SQLInterface

    diff --git a/docs/classes/Query_Drivers_Sqlite_SQL/procedure_list.html b/docs/classes/Query_Drivers_Sqlite_SQL/procedure_list.html index 31d6869..acce639 100644 --- a/docs/classes/Query_Drivers_Sqlite_SQL/procedure_list.html +++ b/docs/classes/Query_Drivers_Sqlite_SQL/procedure_list.html @@ -85,7 +85,7 @@

    Defined by Interface

    - SQL_Interface + SQLInterface

    diff --git a/docs/classes/Query_Drivers_Sqlite_SQL/random.html b/docs/classes/Query_Drivers_Sqlite_SQL/random.html index 996aebe..d63f5bb 100644 --- a/docs/classes/Query_Drivers_Sqlite_SQL/random.html +++ b/docs/classes/Query_Drivers_Sqlite_SQL/random.html @@ -84,7 +84,7 @@

    Defined by Interface

    - SQL_Interface + SQLInterface

    diff --git a/docs/classes/Query_Drivers_Sqlite_SQL/sequence_list.html b/docs/classes/Query_Drivers_Sqlite_SQL/sequence_list.html index 66fd895..6bd2b58 100644 --- a/docs/classes/Query_Drivers_Sqlite_SQL/sequence_list.html +++ b/docs/classes/Query_Drivers_Sqlite_SQL/sequence_list.html @@ -85,7 +85,7 @@

    Defined by Interface

    - SQL_Interface + SQLInterface

    diff --git a/docs/classes/Query_Drivers_Sqlite_SQL/system_table_list.html b/docs/classes/Query_Drivers_Sqlite_SQL/system_table_list.html index 69ffd8a..4c8f8e8 100644 --- a/docs/classes/Query_Drivers_Sqlite_SQL/system_table_list.html +++ b/docs/classes/Query_Drivers_Sqlite_SQL/system_table_list.html @@ -85,7 +85,7 @@

    Defined by Interface

    - SQL_Interface + SQLInterface

    diff --git a/docs/classes/Query_Drivers_Sqlite_SQL/table_list.html b/docs/classes/Query_Drivers_Sqlite_SQL/table_list.html index 9c4e616..952f1f5 100644 --- a/docs/classes/Query_Drivers_Sqlite_SQL/table_list.html +++ b/docs/classes/Query_Drivers_Sqlite_SQL/table_list.html @@ -84,7 +84,7 @@

    Defined by Interface

    - SQL_Interface + SQLInterface

    diff --git a/docs/classes/Query_Drivers_Sqlite_SQL/trigger_list.html b/docs/classes/Query_Drivers_Sqlite_SQL/trigger_list.html index e4483f7..fa09d69 100644 --- a/docs/classes/Query_Drivers_Sqlite_SQL/trigger_list.html +++ b/docs/classes/Query_Drivers_Sqlite_SQL/trigger_list.html @@ -84,7 +84,7 @@

    Defined by Interface

    - SQL_Interface + SQLInterface

    diff --git a/docs/classes/Query_Drivers_Sqlite_SQL/type_list.html b/docs/classes/Query_Drivers_Sqlite_SQL/type_list.html index d29fb29..0cbc94a 100644 --- a/docs/classes/Query_Drivers_Sqlite_SQL/type_list.html +++ b/docs/classes/Query_Drivers_Sqlite_SQL/type_list.html @@ -85,7 +85,7 @@

    Defined by Interface

    - SQL_Interface + SQLInterface

    diff --git a/docs/classes/Query_Drivers_Sqlite_SQL/view_list.html b/docs/classes/Query_Drivers_Sqlite_SQL/view_list.html index 4c7bfbd..989d07c 100644 --- a/docs/classes/Query_Drivers_Sqlite_SQL/view_list.html +++ b/docs/classes/Query_Drivers_Sqlite_SQL/view_list.html @@ -84,7 +84,7 @@

    Defined by Interface

    - SQL_Interface + SQLInterface

    diff --git a/docs/classes/Query_Drivers_Sqlite_Util.html b/docs/classes/Query_Drivers_Sqlite_Util.html index b65b99e..54eae9e 100644 --- a/docs/classes/Query_Drivers_Sqlite_Util.html +++ b/docs/classes/Query_Drivers_Sqlite_Util.html @@ -73,15 +73,15 @@ -

    Inherited from Query\Abstract_Util

    +

    Inherited from Query\AbstractUtil

    public

    History

    diff --git a/docs/classes/Query_Drivers_Sqlite_Util/backup_data.html b/docs/classes/Query_Drivers_Sqlite_Util/backup_data.html index 74c5c63..bdafbad 100644 --- a/docs/classes/Query_Drivers_Sqlite_Util/backup_data.html +++ b/docs/classes/Query_Drivers_Sqlite_Util/backup_data.html @@ -96,7 +96,7 @@ diff --git a/docs/classes/Query_Drivers_Sqlite_Util/backup_structure.html b/docs/classes/Query_Drivers_Sqlite_Util/backup_structure.html index 5695c34..29c82e0 100644 --- a/docs/classes/Query_Drivers_Sqlite_Util/backup_structure.html +++ b/docs/classes/Query_Drivers_Sqlite_Util/backup_structure.html @@ -85,7 +85,7 @@ diff --git a/docs/classes/Query_Query_Builder.html b/docs/classes/Query_QueryBuilder.html similarity index 61% rename from docs/classes/Query_Query_Builder.html rename to docs/classes/Query_QueryBuilder.html index a71fbcb..c17090b 100644 --- a/docs/classes/Query_Query_Builder.html +++ b/docs/classes/Query_QueryBuilder.html @@ -2,7 +2,7 @@ - phpDox - Query\Query_Builder + phpDox - Query\QueryBuilder @@ -41,7 +41,7 @@
  • Query
  • -
  • Query_Builder
  • +
  • QueryBuilder
  • -

    Query\Query_Builder

    +

    Query\QueryBuilder

    Convenience class for creating sql queries - also the class that instantiates the specific db driver

    Methods

    public

    -

    Inherited from Query\Abstract_Query_Builder

    +

    Inherited from Query\AbstractQueryBuilder

    protected

    History

    diff --git a/docs/classes/Query_Query_Builder/__call.html b/docs/classes/Query_QueryBuilder/__call.html similarity index 92% rename from docs/classes/Query_Query_Builder/__call.html rename to docs/classes/Query_QueryBuilder/__call.html index a0a5f72..42dbc40 100644 --- a/docs/classes/Query_Query_Builder/__call.html +++ b/docs/classes/Query_QueryBuilder/__call.html @@ -42,7 +42,7 @@ Query
  • - Query_Builder + QueryBuilder
  • __call
  • @@ -65,12 +65,12 @@ Throws
  • - Source + Source
  • -

    Query\Query_Builder::__call

    +

    Query\QueryBuilder::__call

    Calls a function further down the inheritence chain

    @@ -59,12 +59,12 @@ Parameter
  • - Source + Source
  • -

    Query\Query_Builder::__construct

    +

    Query\QueryBuilder::__construct

    Constructor

      diff --git a/docs/classes/Query_Query_Builder/__destruct.html b/docs/classes/Query_QueryBuilder/__destruct.html similarity index 89% rename from docs/classes/Query_Query_Builder/__destruct.html rename to docs/classes/Query_QueryBuilder/__destruct.html index 2bb9e11..0aec8ee 100644 --- a/docs/classes/Query_Query_Builder/__destruct.html +++ b/docs/classes/Query_QueryBuilder/__destruct.html @@ -42,7 +42,7 @@ Query
    • - Query_Builder + QueryBuilder
    • __destruct
    @@ -56,12 +56,12 @@ Synopsis
  • - Source + Source
  • -

    Query\Query_Builder::__destruct

    +

    Query\QueryBuilder::__destruct

    Destructor

      diff --git a/docs/classes/Query_Query_Builder/count_all.html b/docs/classes/Query_QueryBuilder/count_all.html similarity index 88% rename from docs/classes/Query_Query_Builder/count_all.html rename to docs/classes/Query_QueryBuilder/count_all.html index 36e0511..f7be09c 100644 --- a/docs/classes/Query_Query_Builder/count_all.html +++ b/docs/classes/Query_QueryBuilder/count_all.html @@ -42,7 +42,7 @@ Query
    • - Query_Builder + QueryBuilder
    • count_all
    @@ -65,12 +65,12 @@ Interface
  • - Source + Source
  • -

    Query\Query_Builder::count_all

    +

    Query\QueryBuilder::count_all

    Retreive the number of rows in the selected table

    diff --git a/docs/classes/Query_Query_Builder/count_all_results.html b/docs/classes/Query_QueryBuilder/count_all_results.html similarity index 88% rename from docs/classes/Query_Query_Builder/count_all_results.html rename to docs/classes/Query_QueryBuilder/count_all_results.html index 43efb91..eb54b1e 100644 --- a/docs/classes/Query_Query_Builder/count_all_results.html +++ b/docs/classes/Query_QueryBuilder/count_all_results.html @@ -42,7 +42,7 @@ Query
  • - Query_Builder + QueryBuilder
  • count_all_results
  • @@ -65,12 +65,12 @@ Interface
  • - Source + Source
  • -

    Query\Query_Builder::count_all_results

    +

    Query\QueryBuilder::count_all_results

    Retrieve the number of results for the generated query - used in place of the get() method

    diff --git a/docs/classes/Query_Query_Builder/delete.html b/docs/classes/Query_QueryBuilder/delete.html similarity index 88% rename from docs/classes/Query_Query_Builder/delete.html rename to docs/classes/Query_QueryBuilder/delete.html index 48bb0e9..e78a85e 100644 --- a/docs/classes/Query_Query_Builder/delete.html +++ b/docs/classes/Query_QueryBuilder/delete.html @@ -42,7 +42,7 @@ Query
  • - Query_Builder + QueryBuilder
  • delete
  • @@ -65,12 +65,12 @@ Interface
  • - Source + Source
  • -

    Query\Query_Builder::delete

    +

    Query\QueryBuilder::delete

    Deletes data from a table

    diff --git a/docs/classes/Query_Query_Builder/distinct.html b/docs/classes/Query_QueryBuilder/distinct.html similarity index 86% rename from docs/classes/Query_Query_Builder/distinct.html rename to docs/classes/Query_QueryBuilder/distinct.html index 29c6031..5f97d55 100644 --- a/docs/classes/Query_Query_Builder/distinct.html +++ b/docs/classes/Query_QueryBuilder/distinct.html @@ -42,7 +42,7 @@ Query
  • - Query_Builder + QueryBuilder
  • distinct
  • @@ -62,12 +62,12 @@ Interface
  • - Source + Source
  • -

    Query\Query_Builder::distinct

    +

    Query\QueryBuilder::distinct

    Adds the 'distinct' keyword to a query

    diff --git a/docs/classes/Query_Query_Builder/explain.html b/docs/classes/Query_QueryBuilder/explain.html similarity index 87% rename from docs/classes/Query_Query_Builder/explain.html rename to docs/classes/Query_QueryBuilder/explain.html index cad39f8..314eff5 100644 --- a/docs/classes/Query_Query_Builder/explain.html +++ b/docs/classes/Query_QueryBuilder/explain.html @@ -42,7 +42,7 @@ Query
  • - Query_Builder + QueryBuilder
  • explain
  • @@ -62,12 +62,12 @@ Interface
  • - Source + Source
  • -

    Query\Query_Builder::explain

    +

    Query\QueryBuilder::explain

    Tell the database to give you the query plan instead of result set

    diff --git a/docs/classes/Query_Query_Builder/from.html b/docs/classes/Query_QueryBuilder/from.html similarity index 88% rename from docs/classes/Query_Query_Builder/from.html rename to docs/classes/Query_QueryBuilder/from.html index bb47f3f..bec5da2 100644 --- a/docs/classes/Query_Query_Builder/from.html +++ b/docs/classes/Query_QueryBuilder/from.html @@ -42,7 +42,7 @@ Query
  • - Query_Builder + QueryBuilder
  • from
  • @@ -65,12 +65,12 @@ Interface
  • - Source + Source
  • -

    Query\Query_Builder::from

    +

    Query\QueryBuilder::from

    Specify the database table to select from

    diff --git a/docs/classes/Query_Query_Builder/get.html b/docs/classes/Query_QueryBuilder/get.html similarity index 89% rename from docs/classes/Query_Query_Builder/get.html rename to docs/classes/Query_QueryBuilder/get.html index 3c75213..86adf9f 100644 --- a/docs/classes/Query_Query_Builder/get.html +++ b/docs/classes/Query_QueryBuilder/get.html @@ -42,7 +42,7 @@ Query
  • - Query_Builder + QueryBuilder
  • get
  • @@ -65,12 +65,12 @@ Interface
  • - Source + Source
  • -

    Query\Query_Builder::get

    +

    Query\QueryBuilder::get

    Select and retrieve all records from the current table, and/or execute current compiled query

    diff --git a/docs/classes/Query_Query_Builder/get_compiled_delete.html b/docs/classes/Query_QueryBuilder/get_compiled_delete.html similarity index 88% rename from docs/classes/Query_Query_Builder/get_compiled_delete.html rename to docs/classes/Query_QueryBuilder/get_compiled_delete.html index 02020b2..0ab3f50 100644 --- a/docs/classes/Query_Query_Builder/get_compiled_delete.html +++ b/docs/classes/Query_QueryBuilder/get_compiled_delete.html @@ -42,7 +42,7 @@ Query
  • - Query_Builder + QueryBuilder
  • get_compiled_delete
  • @@ -65,12 +65,12 @@ Interface
  • - Source + Source
  • -

    Query\Query_Builder::get_compiled_delete

    +

    Query\QueryBuilder::get_compiled_delete

    Returns the generated 'delete' sql query

    diff --git a/docs/classes/Query_Query_Builder/get_compiled_insert.html b/docs/classes/Query_QueryBuilder/get_compiled_insert.html similarity index 88% rename from docs/classes/Query_Query_Builder/get_compiled_insert.html rename to docs/classes/Query_QueryBuilder/get_compiled_insert.html index 9979e07..42e827a 100644 --- a/docs/classes/Query_Query_Builder/get_compiled_insert.html +++ b/docs/classes/Query_QueryBuilder/get_compiled_insert.html @@ -42,7 +42,7 @@ Query
  • - Query_Builder + QueryBuilder
  • get_compiled_insert
  • @@ -65,12 +65,12 @@ Interface
  • - Source + Source
  • -

    Query\Query_Builder::get_compiled_insert

    +

    Query\QueryBuilder::get_compiled_insert

    Returns the generated 'insert' sql query

    diff --git a/docs/classes/Query_Query_Builder/get_compiled_select.html b/docs/classes/Query_QueryBuilder/get_compiled_select.html similarity index 88% rename from docs/classes/Query_Query_Builder/get_compiled_select.html rename to docs/classes/Query_QueryBuilder/get_compiled_select.html index c397cd6..d4e72b1 100644 --- a/docs/classes/Query_Query_Builder/get_compiled_select.html +++ b/docs/classes/Query_QueryBuilder/get_compiled_select.html @@ -42,7 +42,7 @@ Query
  • - Query_Builder + QueryBuilder
  • get_compiled_select
  • @@ -65,12 +65,12 @@ Interface
  • - Source + Source
  • -

    Query\Query_Builder::get_compiled_select

    +

    Query\QueryBuilder::get_compiled_select

    Returns the generated 'select' sql query

    diff --git a/docs/classes/Query_Query_Builder/get_compiled_update.html b/docs/classes/Query_QueryBuilder/get_compiled_update.html similarity index 88% rename from docs/classes/Query_Query_Builder/get_compiled_update.html rename to docs/classes/Query_QueryBuilder/get_compiled_update.html index 177b726..7bae010 100644 --- a/docs/classes/Query_Query_Builder/get_compiled_update.html +++ b/docs/classes/Query_QueryBuilder/get_compiled_update.html @@ -42,7 +42,7 @@ Query
  • - Query_Builder + QueryBuilder
  • get_compiled_update
  • @@ -65,12 +65,12 @@ Interface
  • - Source + Source
  • -

    Query\Query_Builder::get_compiled_update

    +

    Query\QueryBuilder::get_compiled_update

    Returns the generated 'update' sql query

    diff --git a/docs/classes/Query_Query_Builder/get_where.html b/docs/classes/Query_QueryBuilder/get_where.html similarity index 89% rename from docs/classes/Query_Query_Builder/get_where.html rename to docs/classes/Query_QueryBuilder/get_where.html index 1f78dfc..aab5828 100644 --- a/docs/classes/Query_Query_Builder/get_where.html +++ b/docs/classes/Query_QueryBuilder/get_where.html @@ -42,7 +42,7 @@ Query
  • - Query_Builder + QueryBuilder
  • get_where
  • @@ -65,12 +65,12 @@ Interface
  • - Source + Source
  • -

    Query\Query_Builder::get_where

    +

    Query\QueryBuilder::get_where

    Convenience method for get() with a where clause

    diff --git a/docs/classes/Query_Query_Builder/group_by.html b/docs/classes/Query_QueryBuilder/group_by.html similarity index 88% rename from docs/classes/Query_Query_Builder/group_by.html rename to docs/classes/Query_QueryBuilder/group_by.html index 876da84..d233abe 100644 --- a/docs/classes/Query_Query_Builder/group_by.html +++ b/docs/classes/Query_QueryBuilder/group_by.html @@ -42,7 +42,7 @@ Query
  • - Query_Builder + QueryBuilder
  • group_by
  • @@ -65,12 +65,12 @@ Interface
  • - Source + Source
  • -

    Query\Query_Builder::group_by

    +

    Query\QueryBuilder::group_by

    Group the results by the selected field(s)

    diff --git a/docs/classes/Query_Query_Builder/group_end.html b/docs/classes/Query_QueryBuilder/group_end.html similarity index 86% rename from docs/classes/Query_Query_Builder/group_end.html rename to docs/classes/Query_QueryBuilder/group_end.html index f0c5725..ee4e10a 100644 --- a/docs/classes/Query_Query_Builder/group_end.html +++ b/docs/classes/Query_QueryBuilder/group_end.html @@ -42,7 +42,7 @@ Query
  • - Query_Builder + QueryBuilder
  • group_end
  • @@ -62,12 +62,12 @@ Interface
  • - Source + Source
  • -

    Query\Query_Builder::group_end

    +

    Query\QueryBuilder::group_end

    Ends a query group

    diff --git a/docs/classes/Query_Query_Builder/group_start.html b/docs/classes/Query_QueryBuilder/group_start.html similarity index 86% rename from docs/classes/Query_Query_Builder/group_start.html rename to docs/classes/Query_QueryBuilder/group_start.html index dfeabe0..040762e 100644 --- a/docs/classes/Query_Query_Builder/group_start.html +++ b/docs/classes/Query_QueryBuilder/group_start.html @@ -42,7 +42,7 @@ Query
  • - Query_Builder + QueryBuilder
  • group_start
  • @@ -62,12 +62,12 @@ Interface
  • - Source + Source
  • -

    Query\Query_Builder::group_start

    +

    Query\QueryBuilder::group_start

    Adds a paren to the current query for query grouping

    diff --git a/docs/classes/Query_Query_Builder/having.html b/docs/classes/Query_QueryBuilder/having.html similarity index 88% rename from docs/classes/Query_Query_Builder/having.html rename to docs/classes/Query_QueryBuilder/having.html index 7796dbc..ab1122f 100644 --- a/docs/classes/Query_Query_Builder/having.html +++ b/docs/classes/Query_QueryBuilder/having.html @@ -42,7 +42,7 @@ Query
  • - Query_Builder + QueryBuilder
  • having
  • @@ -65,12 +65,12 @@ Interface
  • - Source + Source
  • -

    Query\Query_Builder::having

    +

    Query\QueryBuilder::having

    Generates a 'Having' clause

    diff --git a/docs/classes/Query_Query_Builder/insert.html b/docs/classes/Query_QueryBuilder/insert.html similarity index 88% rename from docs/classes/Query_Query_Builder/insert.html rename to docs/classes/Query_QueryBuilder/insert.html index 832096d..34f13b7 100644 --- a/docs/classes/Query_Query_Builder/insert.html +++ b/docs/classes/Query_QueryBuilder/insert.html @@ -42,7 +42,7 @@ Query
  • - Query_Builder + QueryBuilder
  • insert
  • @@ -65,12 +65,12 @@ Interface
  • - Source + Source
  • -

    Query\Query_Builder::insert

    +

    Query\QueryBuilder::insert

    Creates an insert clause, and executes it

    diff --git a/docs/classes/Query_Query_Builder/insert_batch.html b/docs/classes/Query_QueryBuilder/insert_batch.html similarity index 88% rename from docs/classes/Query_Query_Builder/insert_batch.html rename to docs/classes/Query_QueryBuilder/insert_batch.html index 420ae13..4045967 100644 --- a/docs/classes/Query_Query_Builder/insert_batch.html +++ b/docs/classes/Query_QueryBuilder/insert_batch.html @@ -42,7 +42,7 @@ Query
  • - Query_Builder + QueryBuilder
  • insert_batch
  • @@ -65,12 +65,12 @@ Interface
  • - Source + Source
  • -

    Query\Query_Builder::insert_batch

    +

    Query\QueryBuilder::insert_batch

    Creates and executes a batch insertion query

    diff --git a/docs/classes/Query_Query_Builder/join.html b/docs/classes/Query_QueryBuilder/join.html similarity index 89% rename from docs/classes/Query_Query_Builder/join.html rename to docs/classes/Query_QueryBuilder/join.html index a921c74..07a4e0b 100644 --- a/docs/classes/Query_Query_Builder/join.html +++ b/docs/classes/Query_QueryBuilder/join.html @@ -42,7 +42,7 @@ Query
  • - Query_Builder + QueryBuilder
  • join
  • @@ -65,12 +65,12 @@ Interface
  • - Source + Source
  • -

    Query\Query_Builder::join

    +

    Query\QueryBuilder::join

    Creates a join phrase in a compiled query

    diff --git a/docs/classes/Query_Query_Builder/like.html b/docs/classes/Query_QueryBuilder/like.html similarity index 89% rename from docs/classes/Query_Query_Builder/like.html rename to docs/classes/Query_QueryBuilder/like.html index 3510880..63b94d7 100644 --- a/docs/classes/Query_Query_Builder/like.html +++ b/docs/classes/Query_QueryBuilder/like.html @@ -42,7 +42,7 @@ Query
  • - Query_Builder + QueryBuilder
  • like
  • @@ -65,12 +65,12 @@ Interface
  • - Source + Source
  • -

    Query\Query_Builder::like

    +

    Query\QueryBuilder::like

    Creates a Like clause in the sql statement

    diff --git a/docs/classes/Query_Query_Builder/limit.html b/docs/classes/Query_QueryBuilder/limit.html similarity index 88% rename from docs/classes/Query_Query_Builder/limit.html rename to docs/classes/Query_QueryBuilder/limit.html index 396f48a..5b47e38 100644 --- a/docs/classes/Query_Query_Builder/limit.html +++ b/docs/classes/Query_QueryBuilder/limit.html @@ -42,7 +42,7 @@ Query
  • - Query_Builder + QueryBuilder
  • limit
  • @@ -65,12 +65,12 @@ Interface
  • - Source + Source
  • -

    Query\Query_Builder::limit

    +

    Query\QueryBuilder::limit

    Set a limit on the current sql statement

    diff --git a/docs/classes/Query_Query_Builder/not_like.html b/docs/classes/Query_QueryBuilder/not_like.html similarity index 88% rename from docs/classes/Query_Query_Builder/not_like.html rename to docs/classes/Query_QueryBuilder/not_like.html index d0d4f14..807a891 100644 --- a/docs/classes/Query_Query_Builder/not_like.html +++ b/docs/classes/Query_QueryBuilder/not_like.html @@ -42,7 +42,7 @@ Query
  • - Query_Builder + QueryBuilder
  • not_like
  • @@ -65,12 +65,12 @@ Interface
  • - Source + Source
  • -

    Query\Query_Builder::not_like

    +

    Query\QueryBuilder::not_like

    Generates a NOT LIKE clause

    diff --git a/docs/classes/Query_Query_Builder/or_group_start.html b/docs/classes/Query_QueryBuilder/or_group_start.html similarity index 87% rename from docs/classes/Query_Query_Builder/or_group_start.html rename to docs/classes/Query_QueryBuilder/or_group_start.html index 6127737..bd7e377 100644 --- a/docs/classes/Query_Query_Builder/or_group_start.html +++ b/docs/classes/Query_QueryBuilder/or_group_start.html @@ -42,7 +42,7 @@ Query
  • - Query_Builder + QueryBuilder
  • or_group_start
  • @@ -62,12 +62,12 @@ Interface
  • - Source + Source
  • -

    Query\Query_Builder::or_group_start

    +

    Query\QueryBuilder::or_group_start

    Adds a paren to the current query for query grouping, prefixed with 'OR'

    diff --git a/docs/classes/Query_Query_Builder/or_having.html b/docs/classes/Query_QueryBuilder/or_having.html similarity index 88% rename from docs/classes/Query_Query_Builder/or_having.html rename to docs/classes/Query_QueryBuilder/or_having.html index 5e8b345..f347024 100644 --- a/docs/classes/Query_Query_Builder/or_having.html +++ b/docs/classes/Query_QueryBuilder/or_having.html @@ -42,7 +42,7 @@ Query
  • - Query_Builder + QueryBuilder
  • or_having
  • @@ -65,12 +65,12 @@ Interface
  • - Source + Source
  • -

    Query\Query_Builder::or_having

    +

    Query\QueryBuilder::or_having

    Generates a 'Having' clause prefixed with 'OR'

    diff --git a/docs/classes/Query_Query_Builder/or_like.html b/docs/classes/Query_QueryBuilder/or_like.html similarity index 88% rename from docs/classes/Query_Query_Builder/or_like.html rename to docs/classes/Query_QueryBuilder/or_like.html index 2c0c6ff..340b0f7 100644 --- a/docs/classes/Query_Query_Builder/or_like.html +++ b/docs/classes/Query_QueryBuilder/or_like.html @@ -42,7 +42,7 @@ Query
  • - Query_Builder + QueryBuilder
  • or_like
  • @@ -65,12 +65,12 @@ Interface
  • - Source + Source
  • -

    Query\Query_Builder::or_like

    +

    Query\QueryBuilder::or_like

    Generates an OR Like clause

    diff --git a/docs/classes/Query_Query_Builder/or_not_group_start.html b/docs/classes/Query_QueryBuilder/or_not_group_start.html similarity index 86% rename from docs/classes/Query_Query_Builder/or_not_group_start.html rename to docs/classes/Query_QueryBuilder/or_not_group_start.html index 7704279..6214ea0 100644 --- a/docs/classes/Query_Query_Builder/or_not_group_start.html +++ b/docs/classes/Query_QueryBuilder/or_not_group_start.html @@ -42,7 +42,7 @@ Query
  • - Query_Builder + QueryBuilder
  • or_not_group_start
  • @@ -62,12 +62,12 @@ Interface
  • - Source + Source
  • -

    Query\Query_Builder::or_not_group_start

    +

    Query\QueryBuilder::or_not_group_start

    Adds a paren to the current query for query grouping, prefixed with 'OR NOT'

    diff --git a/docs/classes/Query_Query_Builder/or_not_like.html b/docs/classes/Query_QueryBuilder/or_not_like.html similarity index 88% rename from docs/classes/Query_Query_Builder/or_not_like.html rename to docs/classes/Query_QueryBuilder/or_not_like.html index 3356d9a..3d5858a 100644 --- a/docs/classes/Query_Query_Builder/or_not_like.html +++ b/docs/classes/Query_QueryBuilder/or_not_like.html @@ -42,7 +42,7 @@ Query
  • - Query_Builder + QueryBuilder
  • or_not_like
  • @@ -65,12 +65,12 @@ Interface
  • - Source + Source
  • -

    Query\Query_Builder::or_not_like

    +

    Query\QueryBuilder::or_not_like

    Generates a OR NOT LIKE clause

    diff --git a/docs/classes/Query_Query_Builder/or_where.html b/docs/classes/Query_QueryBuilder/or_where.html similarity index 88% rename from docs/classes/Query_Query_Builder/or_where.html rename to docs/classes/Query_QueryBuilder/or_where.html index fb3d6c9..447a9a3 100644 --- a/docs/classes/Query_Query_Builder/or_where.html +++ b/docs/classes/Query_QueryBuilder/or_where.html @@ -42,7 +42,7 @@ Query
  • - Query_Builder + QueryBuilder
  • or_where
  • @@ -65,12 +65,12 @@ Interface
  • - Source + Source
  • -

    Query\Query_Builder::or_where

    +

    Query\QueryBuilder::or_where

    Where clause prefixed with "OR"

    diff --git a/docs/classes/Query_Query_Builder/or_where_in.html b/docs/classes/Query_QueryBuilder/or_where_in.html similarity index 88% rename from docs/classes/Query_Query_Builder/or_where_in.html rename to docs/classes/Query_QueryBuilder/or_where_in.html index a0e8430..ab3d476 100644 --- a/docs/classes/Query_Query_Builder/or_where_in.html +++ b/docs/classes/Query_QueryBuilder/or_where_in.html @@ -42,7 +42,7 @@ Query
  • - Query_Builder + QueryBuilder
  • or_where_in
  • @@ -65,12 +65,12 @@ Interface
  • - Source + Source
  • -

    Query\Query_Builder::or_where_in

    +

    Query\QueryBuilder::or_where_in

    Where in statement prefixed with "or"

    diff --git a/docs/classes/Query_Query_Builder/or_where_not_in.html b/docs/classes/Query_QueryBuilder/or_where_not_in.html similarity index 88% rename from docs/classes/Query_Query_Builder/or_where_not_in.html rename to docs/classes/Query_QueryBuilder/or_where_not_in.html index 93f916f..94d51fd 100644 --- a/docs/classes/Query_Query_Builder/or_where_not_in.html +++ b/docs/classes/Query_QueryBuilder/or_where_not_in.html @@ -42,7 +42,7 @@ Query
  • - Query_Builder + QueryBuilder
  • or_where_not_in
  • @@ -65,12 +65,12 @@ Interface
  • - Source + Source
  • -

    Query\Query_Builder::or_where_not_in

    +

    Query\QueryBuilder::or_where_not_in

    OR WHERE NOT IN (FOO) clause

    diff --git a/docs/classes/Query_Query_Builder/order_by.html b/docs/classes/Query_QueryBuilder/order_by.html similarity index 88% rename from docs/classes/Query_Query_Builder/order_by.html rename to docs/classes/Query_QueryBuilder/order_by.html index f59abfc..3811280 100644 --- a/docs/classes/Query_Query_Builder/order_by.html +++ b/docs/classes/Query_QueryBuilder/order_by.html @@ -42,7 +42,7 @@ Query
  • - Query_Builder + QueryBuilder
  • order_by
  • @@ -65,12 +65,12 @@ Interface
  • - Source + Source
  • -

    Query\Query_Builder::order_by

    +

    Query\QueryBuilder::order_by

    Order the results by the selected field(s)

    diff --git a/docs/classes/Query_Query_Builder/reset_query.html b/docs/classes/Query_QueryBuilder/reset_query.html similarity index 86% rename from docs/classes/Query_Query_Builder/reset_query.html rename to docs/classes/Query_QueryBuilder/reset_query.html index 1af930e..b7c63ed 100644 --- a/docs/classes/Query_Query_Builder/reset_query.html +++ b/docs/classes/Query_QueryBuilder/reset_query.html @@ -42,7 +42,7 @@ Query
  • - Query_Builder + QueryBuilder
  • reset_query
  • @@ -62,12 +62,12 @@ Interface
  • - Source + Source
  • -

    Query\Query_Builder::reset_query

    +

    Query\QueryBuilder::reset_query

    Clear out the class variables, so the next query can be run

    diff --git a/docs/classes/Query_Query_Builder/select.html b/docs/classes/Query_QueryBuilder/select.html similarity index 88% rename from docs/classes/Query_Query_Builder/select.html rename to docs/classes/Query_QueryBuilder/select.html index 4cd7131..acfe66a 100644 --- a/docs/classes/Query_Query_Builder/select.html +++ b/docs/classes/Query_QueryBuilder/select.html @@ -42,7 +42,7 @@ Query
  • - Query_Builder + QueryBuilder
  • select
  • @@ -65,12 +65,12 @@ Interface
  • - Source + Source
  • -

    Query\Query_Builder::select

    +

    Query\QueryBuilder::select

    Specifies rows to select in a query

    diff --git a/docs/classes/Query_Query_Builder/select_avg.html b/docs/classes/Query_QueryBuilder/select_avg.html similarity index 88% rename from docs/classes/Query_Query_Builder/select_avg.html rename to docs/classes/Query_QueryBuilder/select_avg.html index 4b66fe2..50853d0 100644 --- a/docs/classes/Query_Query_Builder/select_avg.html +++ b/docs/classes/Query_QueryBuilder/select_avg.html @@ -42,7 +42,7 @@ Query
  • - Query_Builder + QueryBuilder
  • select_avg
  • @@ -65,12 +65,12 @@ Interface
  • - Source + Source
  • -

    Query\Query_Builder::select_avg

    +

    Query\QueryBuilder::select_avg

    Selects the average value of a field from a query

    diff --git a/docs/classes/Query_Query_Builder/select_max.html b/docs/classes/Query_QueryBuilder/select_max.html similarity index 88% rename from docs/classes/Query_Query_Builder/select_max.html rename to docs/classes/Query_QueryBuilder/select_max.html index 36a0280..ffe99ad 100644 --- a/docs/classes/Query_Query_Builder/select_max.html +++ b/docs/classes/Query_QueryBuilder/select_max.html @@ -42,7 +42,7 @@ Query
  • - Query_Builder + QueryBuilder
  • select_max
  • @@ -65,12 +65,12 @@ Interface
  • - Source + Source
  • -

    Query\Query_Builder::select_max

    +

    Query\QueryBuilder::select_max

    Selects the maximum value of a field from a query

    diff --git a/docs/classes/Query_Query_Builder/select_min.html b/docs/classes/Query_QueryBuilder/select_min.html similarity index 88% rename from docs/classes/Query_Query_Builder/select_min.html rename to docs/classes/Query_QueryBuilder/select_min.html index 800f66d..c5b2a00 100644 --- a/docs/classes/Query_Query_Builder/select_min.html +++ b/docs/classes/Query_QueryBuilder/select_min.html @@ -42,7 +42,7 @@ Query
  • - Query_Builder + QueryBuilder
  • select_min
  • @@ -65,12 +65,12 @@ Interface
  • - Source + Source
  • -

    Query\Query_Builder::select_min

    +

    Query\QueryBuilder::select_min

    Selects the minimum value of a field from a query

    diff --git a/docs/classes/Query_Query_Builder/select_sum.html b/docs/classes/Query_QueryBuilder/select_sum.html similarity index 88% rename from docs/classes/Query_Query_Builder/select_sum.html rename to docs/classes/Query_QueryBuilder/select_sum.html index aa657db..9db1be7 100644 --- a/docs/classes/Query_Query_Builder/select_sum.html +++ b/docs/classes/Query_QueryBuilder/select_sum.html @@ -42,7 +42,7 @@ Query
  • - Query_Builder + QueryBuilder
  • select_sum
  • @@ -65,12 +65,12 @@ Interface
  • - Source + Source
  • -

    Query\Query_Builder::select_sum

    +

    Query\QueryBuilder::select_sum

    Selects the sum of a field from a query

    diff --git a/docs/classes/Query_Query_Builder/set.html b/docs/classes/Query_QueryBuilder/set.html similarity index 88% rename from docs/classes/Query_Query_Builder/set.html rename to docs/classes/Query_QueryBuilder/set.html index f0fe238..a226d1f 100644 --- a/docs/classes/Query_Query_Builder/set.html +++ b/docs/classes/Query_QueryBuilder/set.html @@ -42,7 +42,7 @@ Query
  • - Query_Builder + QueryBuilder
  • set
  • @@ -65,12 +65,12 @@ Interface
  • - Source + Source
  • -

    Query\Query_Builder::set

    +

    Query\QueryBuilder::set

    Sets values for inserts / updates / deletes

    diff --git a/docs/classes/Query_Query_Builder/update.html b/docs/classes/Query_QueryBuilder/update.html similarity index 88% rename from docs/classes/Query_Query_Builder/update.html rename to docs/classes/Query_QueryBuilder/update.html index 4e4caff..38afd30 100644 --- a/docs/classes/Query_Query_Builder/update.html +++ b/docs/classes/Query_QueryBuilder/update.html @@ -42,7 +42,7 @@ Query
  • - Query_Builder + QueryBuilder
  • update
  • @@ -65,12 +65,12 @@ Interface
  • - Source + Source
  • -

    Query\Query_Builder::update

    +

    Query\QueryBuilder::update

    Creates an update clause, and executes it

    diff --git a/docs/classes/Query_Query_Builder/where.html b/docs/classes/Query_QueryBuilder/where.html similarity index 89% rename from docs/classes/Query_Query_Builder/where.html rename to docs/classes/Query_QueryBuilder/where.html index 572f68a..8107f15 100644 --- a/docs/classes/Query_Query_Builder/where.html +++ b/docs/classes/Query_QueryBuilder/where.html @@ -42,7 +42,7 @@ Query
  • - Query_Builder + QueryBuilder
  • where
  • @@ -65,12 +65,12 @@ Interface
  • - Source + Source
  • -

    Query\Query_Builder::where

    +

    Query\QueryBuilder::where

    Specify condition(s) in the where clause of a query Note: this function works with key / value, or a passed array with key / value pairs

    diff --git a/docs/classes/Query_Query_Builder/where_in.html b/docs/classes/Query_QueryBuilder/where_in.html similarity index 88% rename from docs/classes/Query_Query_Builder/where_in.html rename to docs/classes/Query_QueryBuilder/where_in.html index b127e86..78a26dd 100644 --- a/docs/classes/Query_Query_Builder/where_in.html +++ b/docs/classes/Query_QueryBuilder/where_in.html @@ -42,7 +42,7 @@ Query
  • - Query_Builder + QueryBuilder
  • where_in
  • @@ -65,12 +65,12 @@ Interface
  • - Source + Source
  • -

    Query\Query_Builder::where_in

    +

    Query\QueryBuilder::where_in

    Where clause with 'IN' statement

    diff --git a/docs/classes/Query_Query_Builder/where_not_in.html b/docs/classes/Query_QueryBuilder/where_not_in.html similarity index 88% rename from docs/classes/Query_Query_Builder/where_not_in.html rename to docs/classes/Query_QueryBuilder/where_not_in.html index 11579ff..9dc3856 100644 --- a/docs/classes/Query_Query_Builder/where_not_in.html +++ b/docs/classes/Query_QueryBuilder/where_not_in.html @@ -42,7 +42,7 @@ Query
  • - Query_Builder + QueryBuilder
  • where_not_in
  • @@ -65,12 +65,12 @@ Interface
  • - Source + Source
  • -

    Query\Query_Builder::where_not_in

    +

    Query\QueryBuilder::where_not_in

    WHERE NOT IN (FOO) clause

    diff --git a/docs/classes/Query_Query_Parser.html b/docs/classes/Query_QueryParser.html similarity index 87% rename from docs/classes/Query_Query_Parser.html rename to docs/classes/Query_QueryParser.html index 62dab66..97672eb 100644 --- a/docs/classes/Query_Query_Parser.html +++ b/docs/classes/Query_QueryParser.html @@ -2,7 +2,7 @@ - phpDox - Query\Query_Parser + phpDox - Query\QueryParser @@ -41,7 +41,7 @@
  • Query
  • -
  • Query_Parser
  • +
  • QueryParser
  • -

    Query\Query_Parser

    +

    Query\QueryParser

    Utility Class to parse sql clauses for properly escaping identifiers

      Synopsis

      -
      class Query_Parser +
      class QueryParser {
      }
      @@ -107,21 +107,31 @@

      protected

      public

      History

        +
      • +

        2015-11-10T10:12:23-05:00 (commit #b5a141f)

        +
        +

        + Author: Timothy J Warren (tim@timshomepage.net) / + Commiter: Timothy J Warren (tim@timshomepage.net) +

        +
        Make class names Pascal Case
        +
        +
      • 2015-07-31T10:24:34-04:00 (commit #056e8bf)

        @@ -272,16 +282,6 @@
        Update year
      • -
      • -

        2012-08-09T12:15:36-04:00 (commit #90c6760)

        -
        -

        - Author: Timothy Warren (tim@timshomepage.net) / - Commiter: Timothy Warren (tim@timshomepage.net) -

        -
        Parsed join conditions fixes #2
        -
        -
    diff --git a/docs/classes/Query_Query_Parser/__construct.html b/docs/classes/Query_QueryParser/__construct.html similarity index 91% rename from docs/classes/Query_Query_Parser/__construct.html rename to docs/classes/Query_QueryParser/__construct.html index 2b9f245..9016503 100644 --- a/docs/classes/Query_Query_Parser/__construct.html +++ b/docs/classes/Query_QueryParser/__construct.html @@ -42,7 +42,7 @@ Query
  • - Query_Parser + QueryParser
  • __construct
  • @@ -59,12 +59,12 @@ Parameter
  • - Source + Source
  • -

    Query\Query_Parser::__construct

    +

    Query\QueryParser::__construct

    Constructor/entry point into parser

      diff --git a/docs/classes/Query_Query_Parser/compile_join.html b/docs/classes/Query_QueryParser/compile_join.html similarity index 91% rename from docs/classes/Query_Query_Parser/compile_join.html rename to docs/classes/Query_QueryParser/compile_join.html index 134d0e5..038324e 100644 --- a/docs/classes/Query_Query_Parser/compile_join.html +++ b/docs/classes/Query_QueryParser/compile_join.html @@ -42,7 +42,7 @@ Query
    • - Query_Parser + QueryParser
    • compile_join
    @@ -62,12 +62,12 @@ Return
  • - Source + Source
  • -

    Query\Query_Parser::compile_join

    +

    Query\QueryParser::compile_join

    Compiles a join condition after parsing

      diff --git a/docs/classes/Query_Query_Parser/filter_array.html b/docs/classes/Query_QueryParser/filter_array.html similarity index 91% rename from docs/classes/Query_Query_Parser/filter_array.html rename to docs/classes/Query_QueryParser/filter_array.html index 88db2ed..9902779 100644 --- a/docs/classes/Query_Query_Parser/filter_array.html +++ b/docs/classes/Query_QueryParser/filter_array.html @@ -42,7 +42,7 @@ Query
    • - Query_Parser + QueryParser
    • filter_array
    @@ -62,12 +62,12 @@ Return
  • - Source + Source
  • -

    Query\Query_Parser::filter_array

    +

    Query\QueryParser::filter_array

    Returns a more useful match array

      diff --git a/docs/classes/Query_Query_Parser/parse_join.html b/docs/classes/Query_QueryParser/parse_join.html similarity index 91% rename from docs/classes/Query_Query_Parser/parse_join.html rename to docs/classes/Query_QueryParser/parse_join.html index 807cb6d..d438779 100644 --- a/docs/classes/Query_Query_Parser/parse_join.html +++ b/docs/classes/Query_QueryParser/parse_join.html @@ -42,7 +42,7 @@ Query
    • - Query_Parser + QueryParser
    • parse_join
    @@ -62,12 +62,12 @@ Return
  • - Source + Source
  • -

    Query\Query_Parser::parse_join

    +

    Query\QueryParser::parse_join

    Parser method for setting the parse string

    @@ -59,12 +59,12 @@ Parameter
  • - Source + Source
  • -

    Query\Driver_Interface::__construct

    +

    Query\DriverInterface::__construct

    Constructor/Connection method

      diff --git a/docs/interfaces/Query_Driver_Interface/affected_rows.html b/docs/interfaces/Query_DriverInterface/affected_rows.html similarity index 89% rename from docs/interfaces/Query_Driver_Interface/affected_rows.html rename to docs/interfaces/Query_DriverInterface/affected_rows.html index 5a5c7fd..2c142ba 100644 --- a/docs/interfaces/Query_Driver_Interface/affected_rows.html +++ b/docs/interfaces/Query_DriverInterface/affected_rows.html @@ -42,7 +42,7 @@ Query
    • - Driver_Interface + DriverInterface
    • affected_rows
    @@ -59,12 +59,12 @@ Return
  • - Source + Source
  • -

    Query\Driver_Interface::affected_rows

    +

    Query\DriverInterface::affected_rows

    Returns number of rows affected by an INSERT, UPDATE, DELETE type query

      diff --git a/docs/interfaces/Query_Driver_Interface/beginTransaction.html b/docs/interfaces/Query_DriverInterface/beginTransaction.html similarity index 89% rename from docs/interfaces/Query_Driver_Interface/beginTransaction.html rename to docs/interfaces/Query_DriverInterface/beginTransaction.html index 8053bfa..37b27b0 100644 --- a/docs/interfaces/Query_Driver_Interface/beginTransaction.html +++ b/docs/interfaces/Query_DriverInterface/beginTransaction.html @@ -42,7 +42,7 @@ Query
    • - Driver_Interface + DriverInterface
    • beginTransaction
    @@ -59,12 +59,12 @@ Return
  • - Source + Source
  • -

    Query\Driver_Interface::beginTransaction

    +

    Query\DriverInterface::beginTransaction

    Begin a transaction

      diff --git a/docs/interfaces/Query_Driver_Interface/commit.html b/docs/interfaces/Query_DriverInterface/commit.html similarity index 89% rename from docs/interfaces/Query_Driver_Interface/commit.html rename to docs/interfaces/Query_DriverInterface/commit.html index cc22348..d4c74ba 100644 --- a/docs/interfaces/Query_Driver_Interface/commit.html +++ b/docs/interfaces/Query_DriverInterface/commit.html @@ -42,7 +42,7 @@ Query
    • - Driver_Interface + DriverInterface
    • commit
    @@ -59,12 +59,12 @@ Return
  • - Source + Source
  • -

    Query\Driver_Interface::commit

    +

    Query\DriverInterface::commit

    Commit a transaction

      diff --git a/docs/interfaces/Query_Driver_Interface/driver_query.html b/docs/interfaces/Query_DriverInterface/driver_query.html similarity index 91% rename from docs/interfaces/Query_Driver_Interface/driver_query.html rename to docs/interfaces/Query_DriverInterface/driver_query.html index 2acbd30..cf1175e 100644 --- a/docs/interfaces/Query_Driver_Interface/driver_query.html +++ b/docs/interfaces/Query_DriverInterface/driver_query.html @@ -42,7 +42,7 @@ Query
    • - Driver_Interface + DriverInterface
    • driver_query
    @@ -62,12 +62,12 @@ Return
  • - Source + Source
  • -

    Query\Driver_Interface::driver_query

    +

    Query\DriverInterface::driver_query

    Method to simplify retrieving db results for meta-data queries

      diff --git a/docs/interfaces/Query_Driver_Interface/errorCode.html b/docs/interfaces/Query_DriverInterface/errorCode.html similarity index 89% rename from docs/interfaces/Query_Driver_Interface/errorCode.html rename to docs/interfaces/Query_DriverInterface/errorCode.html index 9823be6..a947e84 100644 --- a/docs/interfaces/Query_Driver_Interface/errorCode.html +++ b/docs/interfaces/Query_DriverInterface/errorCode.html @@ -42,7 +42,7 @@ Query
    • - Driver_Interface + DriverInterface
    • errorCode
    @@ -59,12 +59,12 @@ Return
  • - Source + Source
  • -

    Query\Driver_Interface::errorCode

    +

    Query\DriverInterface::errorCode

    Return the current error code

      diff --git a/docs/interfaces/Query_Driver_Interface/errorInfo.html b/docs/interfaces/Query_DriverInterface/errorInfo.html similarity index 89% rename from docs/interfaces/Query_Driver_Interface/errorInfo.html rename to docs/interfaces/Query_DriverInterface/errorInfo.html index be2200f..9f966cf 100644 --- a/docs/interfaces/Query_Driver_Interface/errorInfo.html +++ b/docs/interfaces/Query_DriverInterface/errorInfo.html @@ -42,7 +42,7 @@ Query
    • - Driver_Interface + DriverInterface
    • errorInfo
    @@ -59,12 +59,12 @@ Return
  • - Source + Source
  • -

    Query\Driver_Interface::errorInfo

    +

    Query\DriverInterface::errorInfo

    Return information about the current error

      diff --git a/docs/interfaces/Query_Driver_Interface/exec.html b/docs/interfaces/Query_DriverInterface/exec.html similarity index 91% rename from docs/interfaces/Query_Driver_Interface/exec.html rename to docs/interfaces/Query_DriverInterface/exec.html index aac02ec..52dbba3 100644 --- a/docs/interfaces/Query_Driver_Interface/exec.html +++ b/docs/interfaces/Query_DriverInterface/exec.html @@ -42,7 +42,7 @@ Query
    • - Driver_Interface + DriverInterface
    • exec
    @@ -62,12 +62,12 @@ Return
  • - Source + Source
  • -

    Query\Driver_Interface::exec

    +

    Query\DriverInterface::exec

    Execute an SQL statement and return the number of affected rows

      diff --git a/docs/interfaces/Query_Driver_Interface/getAttribute.html b/docs/interfaces/Query_DriverInterface/getAttribute.html similarity index 90% rename from docs/interfaces/Query_Driver_Interface/getAttribute.html rename to docs/interfaces/Query_DriverInterface/getAttribute.html index 8b1dc47..4655579 100644 --- a/docs/interfaces/Query_Driver_Interface/getAttribute.html +++ b/docs/interfaces/Query_DriverInterface/getAttribute.html @@ -42,7 +42,7 @@ Query
    • - Driver_Interface + DriverInterface
    • getAttribute
    @@ -62,12 +62,12 @@ Return
  • - Source + Source
  • -

    Query\Driver_Interface::getAttribute

    +

    Query\DriverInterface::getAttribute

    Get a connection attribute for the current db driver

      diff --git a/docs/interfaces/Query_Driver_Interface/get_columns.html b/docs/interfaces/Query_DriverInterface/get_columns.html similarity index 90% rename from docs/interfaces/Query_Driver_Interface/get_columns.html rename to docs/interfaces/Query_DriverInterface/get_columns.html index 0d22edf..3e9c2be 100644 --- a/docs/interfaces/Query_Driver_Interface/get_columns.html +++ b/docs/interfaces/Query_DriverInterface/get_columns.html @@ -42,7 +42,7 @@ Query
    • - Driver_Interface + DriverInterface
    • get_columns
    @@ -62,12 +62,12 @@ Return
  • - Source + Source
  • -

    Query\Driver_Interface::get_columns

    +

    Query\DriverInterface::get_columns

    Retrieve column information for the current database table

      diff --git a/docs/interfaces/Query_Driver_Interface/get_dbs.html b/docs/interfaces/Query_DriverInterface/get_dbs.html similarity index 89% rename from docs/interfaces/Query_Driver_Interface/get_dbs.html rename to docs/interfaces/Query_DriverInterface/get_dbs.html index 2b219f0..615f1d0 100644 --- a/docs/interfaces/Query_Driver_Interface/get_dbs.html +++ b/docs/interfaces/Query_DriverInterface/get_dbs.html @@ -42,7 +42,7 @@ Query
    • - Driver_Interface + DriverInterface
    • get_dbs
    @@ -59,12 +59,12 @@ Return
  • - Source + Source
  • -

    Query\Driver_Interface::get_dbs

    +

    Query\DriverInterface::get_dbs

    Return list of dbs for the current connection, if possible

      diff --git a/docs/interfaces/Query_Driver_Interface/get_fks.html b/docs/interfaces/Query_DriverInterface/get_fks.html similarity index 90% rename from docs/interfaces/Query_Driver_Interface/get_fks.html rename to docs/interfaces/Query_DriverInterface/get_fks.html index 6a0c111..dff2c0e 100644 --- a/docs/interfaces/Query_Driver_Interface/get_fks.html +++ b/docs/interfaces/Query_DriverInterface/get_fks.html @@ -42,7 +42,7 @@ Query
    • - Driver_Interface + DriverInterface
    • get_fks
    @@ -62,12 +62,12 @@ Return
  • - Source + Source
  • -

    Query\Driver_Interface::get_fks

    +

    Query\DriverInterface::get_fks

    Retrieve foreign keys for the table

      diff --git a/docs/interfaces/Query_Driver_Interface/get_functions.html b/docs/interfaces/Query_DriverInterface/get_functions.html similarity index 89% rename from docs/interfaces/Query_Driver_Interface/get_functions.html rename to docs/interfaces/Query_DriverInterface/get_functions.html index d17c097..0af5162 100644 --- a/docs/interfaces/Query_Driver_Interface/get_functions.html +++ b/docs/interfaces/Query_DriverInterface/get_functions.html @@ -42,7 +42,7 @@ Query
    • - Driver_Interface + DriverInterface
    • get_functions
    @@ -59,12 +59,12 @@ Return
  • - Source + Source
  • -

    Query\Driver_Interface::get_functions

    +

    Query\DriverInterface::get_functions

    Return list of functions for the current database

      diff --git a/docs/interfaces/Query_Driver_Interface/get_indexes.html b/docs/interfaces/Query_DriverInterface/get_indexes.html similarity index 90% rename from docs/interfaces/Query_Driver_Interface/get_indexes.html rename to docs/interfaces/Query_DriverInterface/get_indexes.html index 0bf0021..c655b87 100644 --- a/docs/interfaces/Query_Driver_Interface/get_indexes.html +++ b/docs/interfaces/Query_DriverInterface/get_indexes.html @@ -42,7 +42,7 @@ Query
    • - Driver_Interface + DriverInterface
    • get_indexes
    @@ -62,12 +62,12 @@ Return
  • - Source + Source
  • -

    Query\Driver_Interface::get_indexes

    +

    Query\DriverInterface::get_indexes

    Retrieve indexes for the table

      diff --git a/docs/interfaces/Query_Driver_Interface/get_procedures.html b/docs/interfaces/Query_DriverInterface/get_procedures.html similarity index 89% rename from docs/interfaces/Query_Driver_Interface/get_procedures.html rename to docs/interfaces/Query_DriverInterface/get_procedures.html index 055eade..b55ed87 100644 --- a/docs/interfaces/Query_Driver_Interface/get_procedures.html +++ b/docs/interfaces/Query_DriverInterface/get_procedures.html @@ -42,7 +42,7 @@ Query
    • - Driver_Interface + DriverInterface
    • get_procedures
    @@ -59,12 +59,12 @@ Return
  • - Source + Source
  • -

    Query\Driver_Interface::get_procedures

    +

    Query\DriverInterface::get_procedures

    Return list of stored procedures for the current database

      diff --git a/docs/interfaces/Query_Driver_Interface/get_sequences.html b/docs/interfaces/Query_DriverInterface/get_sequences.html similarity index 89% rename from docs/interfaces/Query_Driver_Interface/get_sequences.html rename to docs/interfaces/Query_DriverInterface/get_sequences.html index b392437..f5755f4 100644 --- a/docs/interfaces/Query_Driver_Interface/get_sequences.html +++ b/docs/interfaces/Query_DriverInterface/get_sequences.html @@ -42,7 +42,7 @@ Query
    • - Driver_Interface + DriverInterface
    • get_sequences
    @@ -59,12 +59,12 @@ Return
  • - Source + Source
  • -

    Query\Driver_Interface::get_sequences

    +

    Query\DriverInterface::get_sequences

    Return list of sequences for the current database, if they exist

      diff --git a/docs/interfaces/Query_Driver_Interface/get_sql.html b/docs/interfaces/Query_DriverInterface/get_sql.html similarity index 89% rename from docs/interfaces/Query_Driver_Interface/get_sql.html rename to docs/interfaces/Query_DriverInterface/get_sql.html index c459454..800dce4 100644 --- a/docs/interfaces/Query_Driver_Interface/get_sql.html +++ b/docs/interfaces/Query_DriverInterface/get_sql.html @@ -42,7 +42,7 @@ Query
    • - Driver_Interface + DriverInterface
    • get_sql
    @@ -59,12 +59,12 @@ Return
  • - Source + Source
  • -

    Query\Driver_Interface::get_sql

    +

    Query\DriverInterface::get_sql

    Get the SQL class for the current driver

      diff --git a/docs/interfaces/Query_Driver_Interface/get_system_tables.html b/docs/interfaces/Query_DriverInterface/get_system_tables.html similarity index 89% rename from docs/interfaces/Query_Driver_Interface/get_system_tables.html rename to docs/interfaces/Query_DriverInterface/get_system_tables.html index c868802..a854590 100644 --- a/docs/interfaces/Query_Driver_Interface/get_system_tables.html +++ b/docs/interfaces/Query_DriverInterface/get_system_tables.html @@ -42,7 +42,7 @@ Query
    • - Driver_Interface + DriverInterface
    • get_system_tables
    @@ -59,12 +59,12 @@ Return
  • - Source + Source
  • -

    Query\Driver_Interface::get_system_tables

    +

    Query\DriverInterface::get_system_tables

    Retrieves an array of non-user-created tables for the connection/database

      diff --git a/docs/interfaces/Query_Driver_Interface/get_tables.html b/docs/interfaces/Query_DriverInterface/get_tables.html similarity index 89% rename from docs/interfaces/Query_Driver_Interface/get_tables.html rename to docs/interfaces/Query_DriverInterface/get_tables.html index fdb5ddd..fb58798 100644 --- a/docs/interfaces/Query_Driver_Interface/get_tables.html +++ b/docs/interfaces/Query_DriverInterface/get_tables.html @@ -42,7 +42,7 @@ Query
    • - Driver_Interface + DriverInterface
    • get_tables
    @@ -59,12 +59,12 @@ Return
  • - Source + Source
  • -

    Query\Driver_Interface::get_tables

    +

    Query\DriverInterface::get_tables

    Return list of tables for the current database

      diff --git a/docs/interfaces/Query_Driver_Interface/get_triggers.html b/docs/interfaces/Query_DriverInterface/get_triggers.html similarity index 89% rename from docs/interfaces/Query_Driver_Interface/get_triggers.html rename to docs/interfaces/Query_DriverInterface/get_triggers.html index 4066360..fe70eac 100644 --- a/docs/interfaces/Query_Driver_Interface/get_triggers.html +++ b/docs/interfaces/Query_DriverInterface/get_triggers.html @@ -42,7 +42,7 @@ Query
    • - Driver_Interface + DriverInterface
    • get_triggers
    @@ -59,12 +59,12 @@ Return
  • - Source + Source
  • -

    Query\Driver_Interface::get_triggers

    +

    Query\DriverInterface::get_triggers

    Return list of triggers for the current database

      diff --git a/docs/interfaces/Query_Driver_Interface/get_types.html b/docs/interfaces/Query_DriverInterface/get_types.html similarity index 89% rename from docs/interfaces/Query_Driver_Interface/get_types.html rename to docs/interfaces/Query_DriverInterface/get_types.html index d7b18bd..b00b575 100644 --- a/docs/interfaces/Query_Driver_Interface/get_types.html +++ b/docs/interfaces/Query_DriverInterface/get_types.html @@ -42,7 +42,7 @@ Query
    • - Driver_Interface + DriverInterface
    • get_types
    @@ -59,12 +59,12 @@ Return
  • - Source + Source
  • -

    Query\Driver_Interface::get_types

    +

    Query\DriverInterface::get_types

    Retrieve list of data types for the database

      diff --git a/docs/interfaces/Query_Driver_Interface/get_util.html b/docs/interfaces/Query_DriverInterface/get_util.html similarity index 89% rename from docs/interfaces/Query_Driver_Interface/get_util.html rename to docs/interfaces/Query_DriverInterface/get_util.html index 410cd88..29102b5 100644 --- a/docs/interfaces/Query_Driver_Interface/get_util.html +++ b/docs/interfaces/Query_DriverInterface/get_util.html @@ -42,7 +42,7 @@ Query
    • - Driver_Interface + DriverInterface
    • get_util
    @@ -59,12 +59,12 @@ Return
  • - Source + Source
  • -

    Query\Driver_Interface::get_util

    +

    Query\DriverInterface::get_util

    Get the Util class for the current driver

      diff --git a/docs/interfaces/Query_Driver_Interface/get_views.html b/docs/interfaces/Query_DriverInterface/get_views.html similarity index 89% rename from docs/interfaces/Query_Driver_Interface/get_views.html rename to docs/interfaces/Query_DriverInterface/get_views.html index b923d6f..e97516b 100644 --- a/docs/interfaces/Query_Driver_Interface/get_views.html +++ b/docs/interfaces/Query_DriverInterface/get_views.html @@ -42,7 +42,7 @@ Query
    • - Driver_Interface + DriverInterface
    • get_views
    @@ -59,12 +59,12 @@ Return
  • - Source + Source
  • -

    Query\Driver_Interface::get_views

    +

    Query\DriverInterface::get_views

    Return list of views for the current database

      diff --git a/docs/interfaces/Query_Driver_Interface/insert_batch.html b/docs/interfaces/Query_DriverInterface/insert_batch.html similarity index 91% rename from docs/interfaces/Query_Driver_Interface/insert_batch.html rename to docs/interfaces/Query_DriverInterface/insert_batch.html index 1947497..1c71caa 100644 --- a/docs/interfaces/Query_Driver_Interface/insert_batch.html +++ b/docs/interfaces/Query_DriverInterface/insert_batch.html @@ -42,7 +42,7 @@ Query
    • - Driver_Interface + DriverInterface
    • insert_batch
    @@ -62,12 +62,12 @@ Return
  • - Source + Source
  • -

    Query\Driver_Interface::insert_batch

    +

    Query\DriverInterface::insert_batch

    Create sql for batch insert

      diff --git a/docs/interfaces/Query_Driver_Interface/num_rows.html b/docs/interfaces/Query_DriverInterface/num_rows.html similarity index 89% rename from docs/interfaces/Query_Driver_Interface/num_rows.html rename to docs/interfaces/Query_DriverInterface/num_rows.html index 004a7e6..32aa430 100644 --- a/docs/interfaces/Query_Driver_Interface/num_rows.html +++ b/docs/interfaces/Query_DriverInterface/num_rows.html @@ -42,7 +42,7 @@ Query
    • - Driver_Interface + DriverInterface
    • num_rows
    @@ -59,12 +59,12 @@ Return
  • - Source + Source
  • -

    Query\Driver_Interface::num_rows

    +

    Query\DriverInterface::num_rows

    Return the number of rows returned for a SELECT query

      diff --git a/docs/interfaces/Query_Driver_Interface/prefix_table.html b/docs/interfaces/Query_DriverInterface/prefix_table.html similarity index 90% rename from docs/interfaces/Query_Driver_Interface/prefix_table.html rename to docs/interfaces/Query_DriverInterface/prefix_table.html index b30954b..476d54d 100644 --- a/docs/interfaces/Query_Driver_Interface/prefix_table.html +++ b/docs/interfaces/Query_DriverInterface/prefix_table.html @@ -42,7 +42,7 @@ Query
    • - Driver_Interface + DriverInterface
    • prefix_table
    @@ -62,12 +62,12 @@ Return
  • - Source + Source
  • -

    Query\Driver_Interface::prefix_table

    +

    Query\DriverInterface::prefix_table

    Prefixes a table if it is not already prefixed

      diff --git a/docs/interfaces/Query_Driver_Interface/prepare_execute.html b/docs/interfaces/Query_DriverInterface/prepare_execute.html similarity index 91% rename from docs/interfaces/Query_Driver_Interface/prepare_execute.html rename to docs/interfaces/Query_DriverInterface/prepare_execute.html index 2832627..b0f0468 100644 --- a/docs/interfaces/Query_Driver_Interface/prepare_execute.html +++ b/docs/interfaces/Query_DriverInterface/prepare_execute.html @@ -42,7 +42,7 @@ Query
    • - Driver_Interface + DriverInterface
    • prepare_execute
    @@ -62,12 +62,12 @@ Return
  • - Source + Source
  • -

    Query\Driver_Interface::prepare_execute

    +

    Query\DriverInterface::prepare_execute

    Create and execute a prepared statement with the provided parameters

      diff --git a/docs/interfaces/Query_Driver_Interface/prepare_query.html b/docs/interfaces/Query_DriverInterface/prepare_query.html similarity index 92% rename from docs/interfaces/Query_Driver_Interface/prepare_query.html rename to docs/interfaces/Query_DriverInterface/prepare_query.html index 676a74a..f3dd076 100644 --- a/docs/interfaces/Query_Driver_Interface/prepare_query.html +++ b/docs/interfaces/Query_DriverInterface/prepare_query.html @@ -42,7 +42,7 @@ Query
    • - Driver_Interface + DriverInterface
    • prepare_query
    @@ -65,12 +65,12 @@ Throws
  • - Source + Source
  • -

    Query\Driver_Interface::prepare_query

    +

    Query\DriverInterface::prepare_query

    Simplifies prepared statements for database queries

      diff --git a/docs/interfaces/Query_Driver_Interface/quote_ident.html b/docs/interfaces/Query_DriverInterface/quote_ident.html similarity index 91% rename from docs/interfaces/Query_Driver_Interface/quote_ident.html rename to docs/interfaces/Query_DriverInterface/quote_ident.html index 6aa5f35..5f1ee37 100644 --- a/docs/interfaces/Query_Driver_Interface/quote_ident.html +++ b/docs/interfaces/Query_DriverInterface/quote_ident.html @@ -42,7 +42,7 @@ Query
    • - Driver_Interface + DriverInterface
    • quote_ident
    @@ -62,12 +62,12 @@ Return
  • - Source + Source
  • -

    Query\Driver_Interface::quote_ident

    +

    Query\DriverInterface::quote_ident

    Surrounds the string with the databases identifier escape characters

      diff --git a/docs/interfaces/Query_Driver_Interface/quote_table.html b/docs/interfaces/Query_DriverInterface/quote_table.html similarity index 91% rename from docs/interfaces/Query_Driver_Interface/quote_table.html rename to docs/interfaces/Query_DriverInterface/quote_table.html index 3f74193..3817333 100644 --- a/docs/interfaces/Query_Driver_Interface/quote_table.html +++ b/docs/interfaces/Query_DriverInterface/quote_table.html @@ -42,7 +42,7 @@ Query
    • - Driver_Interface + DriverInterface
    • quote_table
    @@ -62,12 +62,12 @@ Return
  • - Source + Source
  • -

    Query\Driver_Interface::quote_table

    +

    Query\DriverInterface::quote_table

    Quote database table name, and set prefix

      diff --git a/docs/interfaces/Query_Driver_Interface/rollback.html b/docs/interfaces/Query_DriverInterface/rollback.html similarity index 89% rename from docs/interfaces/Query_Driver_Interface/rollback.html rename to docs/interfaces/Query_DriverInterface/rollback.html index c0bbbe0..c34741c 100644 --- a/docs/interfaces/Query_Driver_Interface/rollback.html +++ b/docs/interfaces/Query_DriverInterface/rollback.html @@ -42,7 +42,7 @@ Query
    • - Driver_Interface + DriverInterface
    • rollback
    @@ -59,12 +59,12 @@ Return
  • - Source + Source
  • -

    Query\Driver_Interface::rollback

    +

    Query\DriverInterface::rollback

    Rollback a transaction

      diff --git a/docs/interfaces/Query_Driver_Interface/setAttribute.html b/docs/interfaces/Query_DriverInterface/setAttribute.html similarity index 91% rename from docs/interfaces/Query_Driver_Interface/setAttribute.html rename to docs/interfaces/Query_DriverInterface/setAttribute.html index f6ed7c2..476fe9a 100644 --- a/docs/interfaces/Query_Driver_Interface/setAttribute.html +++ b/docs/interfaces/Query_DriverInterface/setAttribute.html @@ -42,7 +42,7 @@ Query
    • - Driver_Interface + DriverInterface
    • setAttribute
    @@ -62,12 +62,12 @@ Return
  • - Source + Source
  • -

    Query\Driver_Interface::setAttribute

    +

    Query\DriverInterface::setAttribute

    Set a connection attribute

      diff --git a/docs/interfaces/Query_Driver_Interface.html b/docs/interfaces/Query_Driver_Interface.html deleted file mode 100644 index 4145823..0000000 --- a/docs/interfaces/Query_Driver_Interface.html +++ /dev/null @@ -1,184 +0,0 @@ - - - - - phpDox - Query\Driver_Interface - - - - - -
      -
      - -
      - -
      -

      Query\Driver_Interface

      -

      PDO Interface to implement for database drivers

      -

      -

      -
      -
      - Generated using phpDox 0.8.2-dev - Copyright (C) 2010 - 2015 by Arne Blankerts -
      - - diff --git a/docs/interfaces/Query_QueryBuilderInterface.html b/docs/interfaces/Query_QueryBuilderInterface.html new file mode 100644 index 0000000..409371a --- /dev/null +++ b/docs/interfaces/Query_QueryBuilderInterface.html @@ -0,0 +1,214 @@ + + + + + phpDox - Query\QueryBuilderInterface + + + + + +
      +
      + +
      + +
      +

      Query\QueryBuilderInterface

      +

      Interface defining the Query Builder class

      +

      +

      +
      +
      + Generated using phpDox 0.8.2-dev - Copyright (C) 2010 - 2015 by Arne Blankerts +
      + + diff --git a/docs/interfaces/Query_Query_Builder_Interface/count_all.html b/docs/interfaces/Query_QueryBuilderInterface/count_all.html similarity index 89% rename from docs/interfaces/Query_Query_Builder_Interface/count_all.html rename to docs/interfaces/Query_QueryBuilderInterface/count_all.html index 72ada87..5b52f96 100644 --- a/docs/interfaces/Query_Query_Builder_Interface/count_all.html +++ b/docs/interfaces/Query_QueryBuilderInterface/count_all.html @@ -42,7 +42,7 @@ Query
    • - Query_Builder_Interface + QueryBuilderInterface
    • count_all
    @@ -62,12 +62,12 @@ Return
  • - Source + Source
  • -

    Query\Query_Builder_Interface::count_all

    +

    Query\QueryBuilderInterface::count_all

    Retrieve the number of rows in the selected table

      diff --git a/docs/interfaces/Query_Query_Builder_Interface/count_all_results.html b/docs/interfaces/Query_QueryBuilderInterface/count_all_results.html similarity index 89% rename from docs/interfaces/Query_Query_Builder_Interface/count_all_results.html rename to docs/interfaces/Query_QueryBuilderInterface/count_all_results.html index 926f61d..25bb617 100644 --- a/docs/interfaces/Query_Query_Builder_Interface/count_all_results.html +++ b/docs/interfaces/Query_QueryBuilderInterface/count_all_results.html @@ -42,7 +42,7 @@ Query
    • - Query_Builder_Interface + QueryBuilderInterface
    • count_all_results
    @@ -62,12 +62,12 @@ Return
  • - Source + Source
  • -

    Query\Query_Builder_Interface::count_all_results

    +

    Query\QueryBuilderInterface::count_all_results

    Retrieve the number of results for the generated query - used in place of the get() method

      diff --git a/docs/interfaces/Query_Query_Builder_Interface/delete.html b/docs/interfaces/Query_QueryBuilderInterface/delete.html similarity index 90% rename from docs/interfaces/Query_Query_Builder_Interface/delete.html rename to docs/interfaces/Query_QueryBuilderInterface/delete.html index ad8dd98..11cdff9 100644 --- a/docs/interfaces/Query_Query_Builder_Interface/delete.html +++ b/docs/interfaces/Query_QueryBuilderInterface/delete.html @@ -42,7 +42,7 @@ Query
    • - Query_Builder_Interface + QueryBuilderInterface
    • delete
    @@ -62,12 +62,12 @@ Return
  • - Source + Source
  • -

    Query\Query_Builder_Interface::delete

    +

    Query\QueryBuilderInterface::delete

    Deletes data from a table

      diff --git a/docs/interfaces/Query_Query_Builder_Interface/distinct.html b/docs/interfaces/Query_QueryBuilderInterface/distinct.html similarity index 88% rename from docs/interfaces/Query_Query_Builder_Interface/distinct.html rename to docs/interfaces/Query_QueryBuilderInterface/distinct.html index 824f351..7946336 100644 --- a/docs/interfaces/Query_Query_Builder_Interface/distinct.html +++ b/docs/interfaces/Query_QueryBuilderInterface/distinct.html @@ -42,7 +42,7 @@ Query
    • - Query_Builder_Interface + QueryBuilderInterface
    • distinct
    @@ -59,12 +59,12 @@ Return
  • - Source + Source
  • -

    Query\Query_Builder_Interface::distinct

    +

    Query\QueryBuilderInterface::distinct

    Adds the 'distinct' keyword to a query

      diff --git a/docs/interfaces/Query_Query_Builder_Interface/explain.html b/docs/interfaces/Query_QueryBuilderInterface/explain.html similarity index 88% rename from docs/interfaces/Query_Query_Builder_Interface/explain.html rename to docs/interfaces/Query_QueryBuilderInterface/explain.html index 73aa3d2..749b323 100644 --- a/docs/interfaces/Query_Query_Builder_Interface/explain.html +++ b/docs/interfaces/Query_QueryBuilderInterface/explain.html @@ -42,7 +42,7 @@ Query
    • - Query_Builder_Interface + QueryBuilderInterface
    • explain
    @@ -59,12 +59,12 @@ Return
  • - Source + Source
  • -

    Query\Query_Builder_Interface::explain

    +

    Query\QueryBuilderInterface::explain

    Shows the query plan for the query

      diff --git a/docs/interfaces/Query_Query_Builder_Interface/from.html b/docs/interfaces/Query_QueryBuilderInterface/from.html similarity index 89% rename from docs/interfaces/Query_Query_Builder_Interface/from.html rename to docs/interfaces/Query_QueryBuilderInterface/from.html index 50b21b6..5f1570d 100644 --- a/docs/interfaces/Query_Query_Builder_Interface/from.html +++ b/docs/interfaces/Query_QueryBuilderInterface/from.html @@ -42,7 +42,7 @@ Query
    • - Query_Builder_Interface + QueryBuilderInterface
    • from
    @@ -62,12 +62,12 @@ Return
  • - Source + Source
  • -

    Query\Query_Builder_Interface::from

    +

    Query\QueryBuilderInterface::from

    Specify the database table to select from

      diff --git a/docs/interfaces/Query_Query_Builder_Interface/get.html b/docs/interfaces/Query_QueryBuilderInterface/get.html similarity index 91% rename from docs/interfaces/Query_Query_Builder_Interface/get.html rename to docs/interfaces/Query_QueryBuilderInterface/get.html index aa9290d..51debbd 100644 --- a/docs/interfaces/Query_Query_Builder_Interface/get.html +++ b/docs/interfaces/Query_QueryBuilderInterface/get.html @@ -42,7 +42,7 @@ Query
    • - Query_Builder_Interface + QueryBuilderInterface
    • get
    @@ -62,12 +62,12 @@ Return
  • - Source + Source
  • -

    Query\Query_Builder_Interface::get

    +

    Query\QueryBuilderInterface::get

    Select and retrieve all records from the current table, and/or execute current compiled query

      diff --git a/docs/interfaces/Query_Query_Builder_Interface/get_compiled_delete.html b/docs/interfaces/Query_QueryBuilderInterface/get_compiled_delete.html similarity index 90% rename from docs/interfaces/Query_Query_Builder_Interface/get_compiled_delete.html rename to docs/interfaces/Query_QueryBuilderInterface/get_compiled_delete.html index 9be6d93..6e932df 100644 --- a/docs/interfaces/Query_Query_Builder_Interface/get_compiled_delete.html +++ b/docs/interfaces/Query_QueryBuilderInterface/get_compiled_delete.html @@ -42,7 +42,7 @@ Query
    • - Query_Builder_Interface + QueryBuilderInterface
    • get_compiled_delete
    @@ -62,12 +62,12 @@ Return
  • - Source + Source
  • -

    Query\Query_Builder_Interface::get_compiled_delete

    +

    Query\QueryBuilderInterface::get_compiled_delete

    Returns the generated 'delete' sql query

      diff --git a/docs/interfaces/Query_Query_Builder_Interface/get_compiled_insert.html b/docs/interfaces/Query_QueryBuilderInterface/get_compiled_insert.html similarity index 90% rename from docs/interfaces/Query_Query_Builder_Interface/get_compiled_insert.html rename to docs/interfaces/Query_QueryBuilderInterface/get_compiled_insert.html index 0175597..6e41bc4 100644 --- a/docs/interfaces/Query_Query_Builder_Interface/get_compiled_insert.html +++ b/docs/interfaces/Query_QueryBuilderInterface/get_compiled_insert.html @@ -42,7 +42,7 @@ Query
    • - Query_Builder_Interface + QueryBuilderInterface
    • get_compiled_insert
    @@ -62,12 +62,12 @@ Return
  • - Source + Source
  • -

    Query\Query_Builder_Interface::get_compiled_insert

    +

    Query\QueryBuilderInterface::get_compiled_insert

    Returns the generated 'insert' sql query

      diff --git a/docs/interfaces/Query_Query_Builder_Interface/get_compiled_select.html b/docs/interfaces/Query_QueryBuilderInterface/get_compiled_select.html similarity index 90% rename from docs/interfaces/Query_Query_Builder_Interface/get_compiled_select.html rename to docs/interfaces/Query_QueryBuilderInterface/get_compiled_select.html index c2c0994..a3d8c90 100644 --- a/docs/interfaces/Query_Query_Builder_Interface/get_compiled_select.html +++ b/docs/interfaces/Query_QueryBuilderInterface/get_compiled_select.html @@ -42,7 +42,7 @@ Query
    • - Query_Builder_Interface + QueryBuilderInterface
    • get_compiled_select
    @@ -62,12 +62,12 @@ Return
  • - Source + Source
  • -

    Query\Query_Builder_Interface::get_compiled_select

    +

    Query\QueryBuilderInterface::get_compiled_select

    Returns the generated 'select' sql query

      diff --git a/docs/interfaces/Query_Query_Builder_Interface/get_compiled_update.html b/docs/interfaces/Query_QueryBuilderInterface/get_compiled_update.html similarity index 90% rename from docs/interfaces/Query_Query_Builder_Interface/get_compiled_update.html rename to docs/interfaces/Query_QueryBuilderInterface/get_compiled_update.html index 4f2412f..0360aaa 100644 --- a/docs/interfaces/Query_Query_Builder_Interface/get_compiled_update.html +++ b/docs/interfaces/Query_QueryBuilderInterface/get_compiled_update.html @@ -42,7 +42,7 @@ Query
    • - Query_Builder_Interface + QueryBuilderInterface
    • get_compiled_update
    @@ -62,12 +62,12 @@ Return
  • - Source + Source
  • -

    Query\Query_Builder_Interface::get_compiled_update

    +

    Query\QueryBuilderInterface::get_compiled_update

    Returns the generated 'update' sql query

      diff --git a/docs/interfaces/Query_Query_Builder_Interface/get_where.html b/docs/interfaces/Query_QueryBuilderInterface/get_where.html similarity index 91% rename from docs/interfaces/Query_Query_Builder_Interface/get_where.html rename to docs/interfaces/Query_QueryBuilderInterface/get_where.html index a25ba45..6b308da 100644 --- a/docs/interfaces/Query_Query_Builder_Interface/get_where.html +++ b/docs/interfaces/Query_QueryBuilderInterface/get_where.html @@ -42,7 +42,7 @@ Query
    • - Query_Builder_Interface + QueryBuilderInterface
    • get_where
    @@ -62,12 +62,12 @@ Return
  • - Source + Source
  • -

    Query\Query_Builder_Interface::get_where

    +

    Query\QueryBuilderInterface::get_where

    Convience method for get() with a where clause

      diff --git a/docs/interfaces/Query_Query_Builder_Interface/group_by.html b/docs/interfaces/Query_QueryBuilderInterface/group_by.html similarity index 89% rename from docs/interfaces/Query_Query_Builder_Interface/group_by.html rename to docs/interfaces/Query_QueryBuilderInterface/group_by.html index 3e12e6f..ae46d01 100644 --- a/docs/interfaces/Query_Query_Builder_Interface/group_by.html +++ b/docs/interfaces/Query_QueryBuilderInterface/group_by.html @@ -42,7 +42,7 @@ Query
    • - Query_Builder_Interface + QueryBuilderInterface
    • group_by
    @@ -62,12 +62,12 @@ Return
  • - Source + Source
  • -

    Query\Query_Builder_Interface::group_by

    +

    Query\QueryBuilderInterface::group_by

    Group the results by the selected field(s)

      diff --git a/docs/interfaces/Query_Query_Builder_Interface/group_end.html b/docs/interfaces/Query_QueryBuilderInterface/group_end.html similarity index 88% rename from docs/interfaces/Query_Query_Builder_Interface/group_end.html rename to docs/interfaces/Query_QueryBuilderInterface/group_end.html index 1c14acc..5d1ff2a 100644 --- a/docs/interfaces/Query_Query_Builder_Interface/group_end.html +++ b/docs/interfaces/Query_QueryBuilderInterface/group_end.html @@ -42,7 +42,7 @@ Query
    • - Query_Builder_Interface + QueryBuilderInterface
    • group_end
    @@ -59,12 +59,12 @@ Return
  • - Source + Source
  • -

    Query\Query_Builder_Interface::group_end

    +

    Query\QueryBuilderInterface::group_end

    Ends a query group

      diff --git a/docs/interfaces/Query_Query_Builder_Interface/group_start.html b/docs/interfaces/Query_QueryBuilderInterface/group_start.html similarity index 88% rename from docs/interfaces/Query_Query_Builder_Interface/group_start.html rename to docs/interfaces/Query_QueryBuilderInterface/group_start.html index 1faa8a6..9b86540 100644 --- a/docs/interfaces/Query_Query_Builder_Interface/group_start.html +++ b/docs/interfaces/Query_QueryBuilderInterface/group_start.html @@ -42,7 +42,7 @@ Query
    • - Query_Builder_Interface + QueryBuilderInterface
    • group_start
    @@ -59,12 +59,12 @@ Return
  • - Source + Source
  • -

    Query\Query_Builder_Interface::group_start

    +

    Query\QueryBuilderInterface::group_start

    Adds a paren to the current query for query grouping

      diff --git a/docs/interfaces/Query_Query_Builder_Interface/having.html b/docs/interfaces/Query_QueryBuilderInterface/having.html similarity index 90% rename from docs/interfaces/Query_Query_Builder_Interface/having.html rename to docs/interfaces/Query_QueryBuilderInterface/having.html index d73037b..a9bebe0 100644 --- a/docs/interfaces/Query_Query_Builder_Interface/having.html +++ b/docs/interfaces/Query_QueryBuilderInterface/having.html @@ -42,7 +42,7 @@ Query
    • - Query_Builder_Interface + QueryBuilderInterface
    • having
    @@ -62,12 +62,12 @@ Return
  • - Source + Source
  • -

    Query\Query_Builder_Interface::having

    +

    Query\QueryBuilderInterface::having

    Generates a 'Having' clause

      diff --git a/docs/interfaces/Query_Query_Builder_Interface/insert.html b/docs/interfaces/Query_QueryBuilderInterface/insert.html similarity index 90% rename from docs/interfaces/Query_Query_Builder_Interface/insert.html rename to docs/interfaces/Query_QueryBuilderInterface/insert.html index 7a9ac2f..565a8b7 100644 --- a/docs/interfaces/Query_Query_Builder_Interface/insert.html +++ b/docs/interfaces/Query_QueryBuilderInterface/insert.html @@ -42,7 +42,7 @@ Query
    • - Query_Builder_Interface + QueryBuilderInterface
    • insert
    @@ -62,12 +62,12 @@ Return
  • - Source + Source
  • -

    Query\Query_Builder_Interface::insert

    +

    Query\QueryBuilderInterface::insert

    Creates an insert clause, and executes it

      diff --git a/docs/interfaces/Query_Query_Builder_Interface/insert_batch.html b/docs/interfaces/Query_QueryBuilderInterface/insert_batch.html similarity index 90% rename from docs/interfaces/Query_Query_Builder_Interface/insert_batch.html rename to docs/interfaces/Query_QueryBuilderInterface/insert_batch.html index 85035ad..8369fd8 100644 --- a/docs/interfaces/Query_Query_Builder_Interface/insert_batch.html +++ b/docs/interfaces/Query_QueryBuilderInterface/insert_batch.html @@ -42,7 +42,7 @@ Query
    • - Query_Builder_Interface + QueryBuilderInterface
    • insert_batch
    @@ -62,12 +62,12 @@ Return
  • - Source + Source
  • -

    Query\Query_Builder_Interface::insert_batch

    +

    Query\QueryBuilderInterface::insert_batch

    Creates and executes a batch insertion query

      diff --git a/docs/interfaces/Query_Query_Builder_Interface/join.html b/docs/interfaces/Query_QueryBuilderInterface/join.html similarity index 90% rename from docs/interfaces/Query_Query_Builder_Interface/join.html rename to docs/interfaces/Query_QueryBuilderInterface/join.html index 72d21ec..0113c42 100644 --- a/docs/interfaces/Query_Query_Builder_Interface/join.html +++ b/docs/interfaces/Query_QueryBuilderInterface/join.html @@ -42,7 +42,7 @@ Query
    • - Query_Builder_Interface + QueryBuilderInterface
    • join
    @@ -62,12 +62,12 @@ Return
  • - Source + Source
  • -

    Query\Query_Builder_Interface::join

    +

    Query\QueryBuilderInterface::join

    Creates a join phrase in a compiled query

      diff --git a/docs/interfaces/Query_Query_Builder_Interface/like.html b/docs/interfaces/Query_QueryBuilderInterface/like.html similarity index 90% rename from docs/interfaces/Query_Query_Builder_Interface/like.html rename to docs/interfaces/Query_QueryBuilderInterface/like.html index aa97e14..ba8dc63 100644 --- a/docs/interfaces/Query_Query_Builder_Interface/like.html +++ b/docs/interfaces/Query_QueryBuilderInterface/like.html @@ -42,7 +42,7 @@ Query
    • - Query_Builder_Interface + QueryBuilderInterface
    • like
    @@ -62,12 +62,12 @@ Return
  • - Source + Source
  • -

    Query\Query_Builder_Interface::like

    +

    Query\QueryBuilderInterface::like

    Creates a Like clause in the sql statement

      diff --git a/docs/interfaces/Query_Query_Builder_Interface/limit.html b/docs/interfaces/Query_QueryBuilderInterface/limit.html similarity index 90% rename from docs/interfaces/Query_Query_Builder_Interface/limit.html rename to docs/interfaces/Query_QueryBuilderInterface/limit.html index 9e4f2ee..83627d4 100644 --- a/docs/interfaces/Query_Query_Builder_Interface/limit.html +++ b/docs/interfaces/Query_QueryBuilderInterface/limit.html @@ -42,7 +42,7 @@ Query
    • - Query_Builder_Interface + QueryBuilderInterface
    • limit
    @@ -62,12 +62,12 @@ Return
  • - Source + Source
  • -

    Query\Query_Builder_Interface::limit

    +

    Query\QueryBuilderInterface::limit

    Set a limit on the current sql statement

      diff --git a/docs/interfaces/Query_Query_Builder_Interface/not_like.html b/docs/interfaces/Query_QueryBuilderInterface/not_like.html similarity index 90% rename from docs/interfaces/Query_Query_Builder_Interface/not_like.html rename to docs/interfaces/Query_QueryBuilderInterface/not_like.html index 4b289b2..34e68df 100644 --- a/docs/interfaces/Query_Query_Builder_Interface/not_like.html +++ b/docs/interfaces/Query_QueryBuilderInterface/not_like.html @@ -42,7 +42,7 @@ Query
    • - Query_Builder_Interface + QueryBuilderInterface
    • not_like
    @@ -62,12 +62,12 @@ Return
  • - Source + Source
  • -

    Query\Query_Builder_Interface::not_like

    +

    Query\QueryBuilderInterface::not_like

    Generates a NOT LIKE clause

      diff --git a/docs/interfaces/Query_Query_Builder_Interface/or_group_start.html b/docs/interfaces/Query_QueryBuilderInterface/or_group_start.html similarity index 88% rename from docs/interfaces/Query_Query_Builder_Interface/or_group_start.html rename to docs/interfaces/Query_QueryBuilderInterface/or_group_start.html index ebeba95..f7bea9f 100644 --- a/docs/interfaces/Query_Query_Builder_Interface/or_group_start.html +++ b/docs/interfaces/Query_QueryBuilderInterface/or_group_start.html @@ -42,7 +42,7 @@ Query
    • - Query_Builder_Interface + QueryBuilderInterface
    • or_group_start
    @@ -59,12 +59,12 @@ Return
  • - Source + Source
  • -

    Query\Query_Builder_Interface::or_group_start

    +

    Query\QueryBuilderInterface::or_group_start

    Adds a paren to the current query for query grouping, prefixed with 'OR'

      diff --git a/docs/interfaces/Query_Query_Builder_Interface/or_having.html b/docs/interfaces/Query_QueryBuilderInterface/or_having.html similarity index 90% rename from docs/interfaces/Query_Query_Builder_Interface/or_having.html rename to docs/interfaces/Query_QueryBuilderInterface/or_having.html index e392f53..e8ea0fa 100644 --- a/docs/interfaces/Query_Query_Builder_Interface/or_having.html +++ b/docs/interfaces/Query_QueryBuilderInterface/or_having.html @@ -42,7 +42,7 @@ Query
    • - Query_Builder_Interface + QueryBuilderInterface
    • or_having
    @@ -62,12 +62,12 @@ Return
  • - Source + Source
  • -

    Query\Query_Builder_Interface::or_having

    +

    Query\QueryBuilderInterface::or_having

    Generates a 'Having' clause prefixed with 'OR'

      diff --git a/docs/interfaces/Query_Query_Builder_Interface/or_like.html b/docs/interfaces/Query_QueryBuilderInterface/or_like.html similarity index 90% rename from docs/interfaces/Query_Query_Builder_Interface/or_like.html rename to docs/interfaces/Query_QueryBuilderInterface/or_like.html index e71a9e5..ee2004a 100644 --- a/docs/interfaces/Query_Query_Builder_Interface/or_like.html +++ b/docs/interfaces/Query_QueryBuilderInterface/or_like.html @@ -42,7 +42,7 @@ Query
    • - Query_Builder_Interface + QueryBuilderInterface
    • or_like
    @@ -62,12 +62,12 @@ Return
  • - Source + Source
  • -

    Query\Query_Builder_Interface::or_like

    +

    Query\QueryBuilderInterface::or_like

    Generates an OR Like clause

      diff --git a/docs/interfaces/Query_Query_Builder_Interface/or_not_group_start.html b/docs/interfaces/Query_QueryBuilderInterface/or_not_group_start.html similarity index 88% rename from docs/interfaces/Query_Query_Builder_Interface/or_not_group_start.html rename to docs/interfaces/Query_QueryBuilderInterface/or_not_group_start.html index 285ebb5..5d4078a 100644 --- a/docs/interfaces/Query_Query_Builder_Interface/or_not_group_start.html +++ b/docs/interfaces/Query_QueryBuilderInterface/or_not_group_start.html @@ -42,7 +42,7 @@ Query
    • - Query_Builder_Interface + QueryBuilderInterface
    • or_not_group_start
    @@ -59,12 +59,12 @@ Return
  • - Source + Source
  • -

    Query\Query_Builder_Interface::or_not_group_start

    +

    Query\QueryBuilderInterface::or_not_group_start

    Adds a paren to the current query for query grouping, prefixed with 'OR NOT'

      diff --git a/docs/interfaces/Query_Query_Builder_Interface/or_not_like.html b/docs/interfaces/Query_QueryBuilderInterface/or_not_like.html similarity index 90% rename from docs/interfaces/Query_Query_Builder_Interface/or_not_like.html rename to docs/interfaces/Query_QueryBuilderInterface/or_not_like.html index ebb2cce..0a325af 100644 --- a/docs/interfaces/Query_Query_Builder_Interface/or_not_like.html +++ b/docs/interfaces/Query_QueryBuilderInterface/or_not_like.html @@ -42,7 +42,7 @@ Query
    • - Query_Builder_Interface + QueryBuilderInterface
    • or_not_like
    @@ -62,12 +62,12 @@ Return
  • - Source + Source
  • -

    Query\Query_Builder_Interface::or_not_like

    +

    Query\QueryBuilderInterface::or_not_like

    Generates a OR NOT LIKE clause

      diff --git a/docs/interfaces/Query_Query_Builder_Interface/or_where.html b/docs/interfaces/Query_QueryBuilderInterface/or_where.html similarity index 90% rename from docs/interfaces/Query_Query_Builder_Interface/or_where.html rename to docs/interfaces/Query_QueryBuilderInterface/or_where.html index 06b062d..800e8c8 100644 --- a/docs/interfaces/Query_Query_Builder_Interface/or_where.html +++ b/docs/interfaces/Query_QueryBuilderInterface/or_where.html @@ -42,7 +42,7 @@ Query
    • - Query_Builder_Interface + QueryBuilderInterface
    • or_where
    @@ -62,12 +62,12 @@ Return
  • - Source + Source
  • -

    Query\Query_Builder_Interface::or_where

    +

    Query\QueryBuilderInterface::or_where

    Where clause prefixed with "OR"

      diff --git a/docs/interfaces/Query_Query_Builder_Interface/or_where_in.html b/docs/interfaces/Query_QueryBuilderInterface/or_where_in.html similarity index 90% rename from docs/interfaces/Query_Query_Builder_Interface/or_where_in.html rename to docs/interfaces/Query_QueryBuilderInterface/or_where_in.html index 61f52f7..cbcb64f 100644 --- a/docs/interfaces/Query_Query_Builder_Interface/or_where_in.html +++ b/docs/interfaces/Query_QueryBuilderInterface/or_where_in.html @@ -42,7 +42,7 @@ Query
    • - Query_Builder_Interface + QueryBuilderInterface
    • or_where_in
    @@ -62,12 +62,12 @@ Return
  • - Source + Source
  • -

    Query\Query_Builder_Interface::or_where_in

    +

    Query\QueryBuilderInterface::or_where_in

    Where in statement prefixed with "or"

      diff --git a/docs/interfaces/Query_Query_Builder_Interface/or_where_not_in.html b/docs/interfaces/Query_QueryBuilderInterface/or_where_not_in.html similarity index 90% rename from docs/interfaces/Query_Query_Builder_Interface/or_where_not_in.html rename to docs/interfaces/Query_QueryBuilderInterface/or_where_not_in.html index ca3383c..94f43c8 100644 --- a/docs/interfaces/Query_Query_Builder_Interface/or_where_not_in.html +++ b/docs/interfaces/Query_QueryBuilderInterface/or_where_not_in.html @@ -42,7 +42,7 @@ Query
    • - Query_Builder_Interface + QueryBuilderInterface
    • or_where_not_in
    @@ -62,12 +62,12 @@ Return
  • - Source + Source
  • -

    Query\Query_Builder_Interface::or_where_not_in

    +

    Query\QueryBuilderInterface::or_where_not_in

    OR WHERE NOT IN (FOO) clause

      diff --git a/docs/interfaces/Query_Query_Builder_Interface/order_by.html b/docs/interfaces/Query_QueryBuilderInterface/order_by.html similarity index 90% rename from docs/interfaces/Query_Query_Builder_Interface/order_by.html rename to docs/interfaces/Query_QueryBuilderInterface/order_by.html index 811ef39..92de071 100644 --- a/docs/interfaces/Query_Query_Builder_Interface/order_by.html +++ b/docs/interfaces/Query_QueryBuilderInterface/order_by.html @@ -42,7 +42,7 @@ Query
    • - Query_Builder_Interface + QueryBuilderInterface
    • order_by
    @@ -62,12 +62,12 @@ Return
  • - Source + Source
  • -

    Query\Query_Builder_Interface::order_by

    +

    Query\QueryBuilderInterface::order_by

    Order the results by the selected field(s)

      diff --git a/docs/interfaces/Query_Query_Builder_Interface/reset_query.html b/docs/interfaces/Query_QueryBuilderInterface/reset_query.html similarity index 88% rename from docs/interfaces/Query_Query_Builder_Interface/reset_query.html rename to docs/interfaces/Query_QueryBuilderInterface/reset_query.html index 72dc01b..2f524d8 100644 --- a/docs/interfaces/Query_Query_Builder_Interface/reset_query.html +++ b/docs/interfaces/Query_QueryBuilderInterface/reset_query.html @@ -42,7 +42,7 @@ Query
    • - Query_Builder_Interface + QueryBuilderInterface
    • reset_query
    @@ -59,12 +59,12 @@ Return
  • - Source + Source
  • -

    Query\Query_Builder_Interface::reset_query

    +

    Query\QueryBuilderInterface::reset_query

    Clear out the class variables, so the next query can be run

      diff --git a/docs/interfaces/Query_Query_Builder_Interface/select.html b/docs/interfaces/Query_QueryBuilderInterface/select.html similarity index 89% rename from docs/interfaces/Query_Query_Builder_Interface/select.html rename to docs/interfaces/Query_QueryBuilderInterface/select.html index 420a652..2682692 100644 --- a/docs/interfaces/Query_Query_Builder_Interface/select.html +++ b/docs/interfaces/Query_QueryBuilderInterface/select.html @@ -42,7 +42,7 @@ Query
    • - Query_Builder_Interface + QueryBuilderInterface
    • select
    @@ -62,12 +62,12 @@ Return
  • - Source + Source
  • -

    Query\Query_Builder_Interface::select

    +

    Query\QueryBuilderInterface::select

    Specifies rows to select in a query

      diff --git a/docs/interfaces/Query_Query_Builder_Interface/select_avg.html b/docs/interfaces/Query_QueryBuilderInterface/select_avg.html similarity index 90% rename from docs/interfaces/Query_Query_Builder_Interface/select_avg.html rename to docs/interfaces/Query_QueryBuilderInterface/select_avg.html index 498d4a7..69f72c3 100644 --- a/docs/interfaces/Query_Query_Builder_Interface/select_avg.html +++ b/docs/interfaces/Query_QueryBuilderInterface/select_avg.html @@ -42,7 +42,7 @@ Query
    • - Query_Builder_Interface + QueryBuilderInterface
    • select_avg
    @@ -62,12 +62,12 @@ Return
  • - Source + Source
  • -

    Query\Query_Builder_Interface::select_avg

    +

    Query\QueryBuilderInterface::select_avg

    Selects the average value of a field from a query

      diff --git a/docs/interfaces/Query_Query_Builder_Interface/select_max.html b/docs/interfaces/Query_QueryBuilderInterface/select_max.html similarity index 90% rename from docs/interfaces/Query_Query_Builder_Interface/select_max.html rename to docs/interfaces/Query_QueryBuilderInterface/select_max.html index 8b43bde..7503b63 100644 --- a/docs/interfaces/Query_Query_Builder_Interface/select_max.html +++ b/docs/interfaces/Query_QueryBuilderInterface/select_max.html @@ -42,7 +42,7 @@ Query
    • - Query_Builder_Interface + QueryBuilderInterface
    • select_max
    @@ -62,12 +62,12 @@ Return
  • - Source + Source
  • -

    Query\Query_Builder_Interface::select_max

    +

    Query\QueryBuilderInterface::select_max

    Selects the maximum value of a field from a query

      diff --git a/docs/interfaces/Query_Query_Builder_Interface/select_min.html b/docs/interfaces/Query_QueryBuilderInterface/select_min.html similarity index 90% rename from docs/interfaces/Query_Query_Builder_Interface/select_min.html rename to docs/interfaces/Query_QueryBuilderInterface/select_min.html index b4214de..90bb5d0 100644 --- a/docs/interfaces/Query_Query_Builder_Interface/select_min.html +++ b/docs/interfaces/Query_QueryBuilderInterface/select_min.html @@ -42,7 +42,7 @@ Query
    • - Query_Builder_Interface + QueryBuilderInterface
    • select_min
    @@ -62,12 +62,12 @@ Return
  • - Source + Source
  • -

    Query\Query_Builder_Interface::select_min

    +

    Query\QueryBuilderInterface::select_min

    Selects the minimum value of a field from a query

      diff --git a/docs/interfaces/Query_Query_Builder_Interface/select_sum.html b/docs/interfaces/Query_QueryBuilderInterface/select_sum.html similarity index 90% rename from docs/interfaces/Query_Query_Builder_Interface/select_sum.html rename to docs/interfaces/Query_QueryBuilderInterface/select_sum.html index f9770b5..b0d1979 100644 --- a/docs/interfaces/Query_Query_Builder_Interface/select_sum.html +++ b/docs/interfaces/Query_QueryBuilderInterface/select_sum.html @@ -42,7 +42,7 @@ Query
    • - Query_Builder_Interface + QueryBuilderInterface
    • select_sum
    @@ -62,12 +62,12 @@ Return
  • - Source + Source
  • -

    Query\Query_Builder_Interface::select_sum

    +

    Query\QueryBuilderInterface::select_sum

    Selects the sum of a field from a query

      diff --git a/docs/interfaces/Query_Query_Builder_Interface/set.html b/docs/interfaces/Query_QueryBuilderInterface/set.html similarity index 90% rename from docs/interfaces/Query_Query_Builder_Interface/set.html rename to docs/interfaces/Query_QueryBuilderInterface/set.html index ca3c53e..75817ef 100644 --- a/docs/interfaces/Query_Query_Builder_Interface/set.html +++ b/docs/interfaces/Query_QueryBuilderInterface/set.html @@ -42,7 +42,7 @@ Query
    • - Query_Builder_Interface + QueryBuilderInterface
    • set
    @@ -62,12 +62,12 @@ Return
  • - Source + Source
  • -

    Query\Query_Builder_Interface::set

    +

    Query\QueryBuilderInterface::set

    Sets values for inserts / updates / deletes

      diff --git a/docs/interfaces/Query_Query_Builder_Interface/update.html b/docs/interfaces/Query_QueryBuilderInterface/update.html similarity index 90% rename from docs/interfaces/Query_Query_Builder_Interface/update.html rename to docs/interfaces/Query_QueryBuilderInterface/update.html index 601d008..b65885d 100644 --- a/docs/interfaces/Query_Query_Builder_Interface/update.html +++ b/docs/interfaces/Query_QueryBuilderInterface/update.html @@ -42,7 +42,7 @@ Query
    • - Query_Builder_Interface + QueryBuilderInterface
    • update
    @@ -62,12 +62,12 @@ Return
  • - Source + Source
  • -

    Query\Query_Builder_Interface::update

    +

    Query\QueryBuilderInterface::update

    Creates an update clause, and executes it

      diff --git a/docs/interfaces/Query_Query_Builder_Interface/where.html b/docs/interfaces/Query_QueryBuilderInterface/where.html similarity index 91% rename from docs/interfaces/Query_Query_Builder_Interface/where.html rename to docs/interfaces/Query_QueryBuilderInterface/where.html index 6f1304e..e58e870 100644 --- a/docs/interfaces/Query_Query_Builder_Interface/where.html +++ b/docs/interfaces/Query_QueryBuilderInterface/where.html @@ -42,7 +42,7 @@ Query
    • - Query_Builder_Interface + QueryBuilderInterface
    • where
    @@ -62,12 +62,12 @@ Return
  • - Source + Source
  • -

    Query\Query_Builder_Interface::where

    +

    Query\QueryBuilderInterface::where

    Specify condition(s) in the where clause of a query Note: this function works with key / value, or a passed array with key / value pairs

      diff --git a/docs/interfaces/Query_Query_Builder_Interface/where_in.html b/docs/interfaces/Query_QueryBuilderInterface/where_in.html similarity index 90% rename from docs/interfaces/Query_Query_Builder_Interface/where_in.html rename to docs/interfaces/Query_QueryBuilderInterface/where_in.html index ea77834..c2e53e8 100644 --- a/docs/interfaces/Query_Query_Builder_Interface/where_in.html +++ b/docs/interfaces/Query_QueryBuilderInterface/where_in.html @@ -42,7 +42,7 @@ Query
    • - Query_Builder_Interface + QueryBuilderInterface
    • where_in
    @@ -62,12 +62,12 @@ Return
  • - Source + Source
  • -

    Query\Query_Builder_Interface::where_in

    +

    Query\QueryBuilderInterface::where_in

    Where clause with 'IN' statement

      diff --git a/docs/interfaces/Query_Query_Builder_Interface/where_not_in.html b/docs/interfaces/Query_QueryBuilderInterface/where_not_in.html similarity index 90% rename from docs/interfaces/Query_Query_Builder_Interface/where_not_in.html rename to docs/interfaces/Query_QueryBuilderInterface/where_not_in.html index 1807dff..e9bf0e0 100644 --- a/docs/interfaces/Query_Query_Builder_Interface/where_not_in.html +++ b/docs/interfaces/Query_QueryBuilderInterface/where_not_in.html @@ -42,7 +42,7 @@ Query
    • - Query_Builder_Interface + QueryBuilderInterface
    • where_not_in
    @@ -62,12 +62,12 @@ Return
  • - Source + Source
  • -

    Query\Query_Builder_Interface::where_not_in

    +

    Query\QueryBuilderInterface::where_not_in

    WHERE NOT IN (FOO) clause

      diff --git a/docs/interfaces/Query_Query_Builder_Interface.html b/docs/interfaces/Query_Query_Builder_Interface.html deleted file mode 100644 index 3aa69cd..0000000 --- a/docs/interfaces/Query_Query_Builder_Interface.html +++ /dev/null @@ -1,214 +0,0 @@ - - - - - phpDox - Query\Query_Builder_Interface - - - - - -
      -
      - -
      - -
      -

      Query\Query_Builder_Interface

      -

      Interface defining the Query Builder class

      -

      -

      -
      -
      - Generated using phpDox 0.8.2-dev - Copyright (C) 2010 - 2015 by Arne Blankerts -
      - - diff --git a/docs/interfaces/Query_SQL_Interface.html b/docs/interfaces/Query_SQLInterface.html similarity index 50% rename from docs/interfaces/Query_SQL_Interface.html rename to docs/interfaces/Query_SQLInterface.html index eef460a..daad4c9 100644 --- a/docs/interfaces/Query_SQL_Interface.html +++ b/docs/interfaces/Query_SQLInterface.html @@ -2,7 +2,7 @@ - phpDox - Query\SQL_Interface + phpDox - Query\SQLInterface @@ -41,7 +41,7 @@
    • Query
    • -
    • SQL_Interface
    • +
    • SQLInterface
    -

    Query\SQL_Interface

    +

    Query\SQLInterface

    parent for database manipulation subclasses

    -

    Query\SQL_Interface::column_list

    +

    Query\SQLInterface::column_list

    Get information about the columns in the specified table

      diff --git a/docs/interfaces/Query_SQL_Interface/db_list.html b/docs/interfaces/Query_SQLInterface/db_list.html similarity index 90% rename from docs/interfaces/Query_SQL_Interface/db_list.html rename to docs/interfaces/Query_SQLInterface/db_list.html index 2b38c05..6dab61f 100644 --- a/docs/interfaces/Query_SQL_Interface/db_list.html +++ b/docs/interfaces/Query_SQLInterface/db_list.html @@ -42,7 +42,7 @@ Query
    • - SQL_Interface + SQLInterface
    • db_list
    @@ -59,12 +59,12 @@ Return
  • - Source + Source
  • -

    Query\SQL_Interface::db_list

    +

    Query\SQLInterface::db_list

    Returns sql to list other databases

      diff --git a/docs/interfaces/Query_SQL_Interface/explain.html b/docs/interfaces/Query_SQLInterface/explain.html similarity index 91% rename from docs/interfaces/Query_SQL_Interface/explain.html rename to docs/interfaces/Query_SQLInterface/explain.html index 98cbb48..ca7d483 100644 --- a/docs/interfaces/Query_SQL_Interface/explain.html +++ b/docs/interfaces/Query_SQLInterface/explain.html @@ -42,7 +42,7 @@ Query
    • - SQL_Interface + SQLInterface
    • explain
    @@ -62,12 +62,12 @@ Return
  • - Source + Source
  • -

    Query\SQL_Interface::explain

    +

    Query\SQLInterface::explain

    Modify the query to get the query plan

      diff --git a/docs/interfaces/Query_SQL_Interface/fk_list.html b/docs/interfaces/Query_SQLInterface/fk_list.html similarity index 91% rename from docs/interfaces/Query_SQL_Interface/fk_list.html rename to docs/interfaces/Query_SQLInterface/fk_list.html index 71dde2e..262bf99 100644 --- a/docs/interfaces/Query_SQL_Interface/fk_list.html +++ b/docs/interfaces/Query_SQLInterface/fk_list.html @@ -42,7 +42,7 @@ Query
    • - SQL_Interface + SQLInterface
    • fk_list
    @@ -62,12 +62,12 @@ Return
  • - Source + Source
  • -

    Query\SQL_Interface::fk_list

    +

    Query\SQLInterface::fk_list

    Get the list of foreign keys for the current table

      diff --git a/docs/interfaces/Query_SQL_Interface/function_list.html b/docs/interfaces/Query_SQLInterface/function_list.html similarity index 90% rename from docs/interfaces/Query_SQL_Interface/function_list.html rename to docs/interfaces/Query_SQLInterface/function_list.html index d5cfe72..7f7a0dc 100644 --- a/docs/interfaces/Query_SQL_Interface/function_list.html +++ b/docs/interfaces/Query_SQLInterface/function_list.html @@ -42,7 +42,7 @@ Query
    • - SQL_Interface + SQLInterface
    • function_list
    @@ -59,12 +59,12 @@ Return
  • - Source + Source
  • -

    Query\SQL_Interface::function_list

    +

    Query\SQLInterface::function_list

    Return sql to list functions

      diff --git a/docs/interfaces/Query_SQL_Interface/index_list.html b/docs/interfaces/Query_SQLInterface/index_list.html similarity index 91% rename from docs/interfaces/Query_SQL_Interface/index_list.html rename to docs/interfaces/Query_SQLInterface/index_list.html index f855391..72206e3 100644 --- a/docs/interfaces/Query_SQL_Interface/index_list.html +++ b/docs/interfaces/Query_SQLInterface/index_list.html @@ -42,7 +42,7 @@ Query
    • - SQL_Interface + SQLInterface
    • index_list
    @@ -62,12 +62,12 @@ Return
  • - Source + Source
  • -

    Query\SQL_Interface::index_list

    +

    Query\SQLInterface::index_list

    Get the list of indexes for the current table

      diff --git a/docs/interfaces/Query_SQL_Interface/limit.html b/docs/interfaces/Query_SQLInterface/limit.html similarity index 92% rename from docs/interfaces/Query_SQL_Interface/limit.html rename to docs/interfaces/Query_SQLInterface/limit.html index 23ba155..d700652 100644 --- a/docs/interfaces/Query_SQL_Interface/limit.html +++ b/docs/interfaces/Query_SQLInterface/limit.html @@ -42,7 +42,7 @@ Query
    • - SQL_Interface + SQLInterface
    • limit
    @@ -62,12 +62,12 @@ Return
  • - Source + Source
  • -

    Query\SQL_Interface::limit

    +

    Query\SQLInterface::limit

    Get database specific sql for limit clause

      diff --git a/docs/interfaces/Query_SQL_Interface/procedure_list.html b/docs/interfaces/Query_SQLInterface/procedure_list.html similarity index 90% rename from docs/interfaces/Query_SQL_Interface/procedure_list.html rename to docs/interfaces/Query_SQLInterface/procedure_list.html index 3ae754e..5123c7a 100644 --- a/docs/interfaces/Query_SQL_Interface/procedure_list.html +++ b/docs/interfaces/Query_SQLInterface/procedure_list.html @@ -42,7 +42,7 @@ Query
    • - SQL_Interface + SQLInterface
    • procedure_list
    @@ -59,12 +59,12 @@ Return
  • - Source + Source
  • -

    Query\SQL_Interface::procedure_list

    +

    Query\SQLInterface::procedure_list

    Return sql to list stored procedures

      diff --git a/docs/interfaces/Query_SQL_Interface/random.html b/docs/interfaces/Query_SQLInterface/random.html similarity index 90% rename from docs/interfaces/Query_SQL_Interface/random.html rename to docs/interfaces/Query_SQLInterface/random.html index a685d87..0188946 100644 --- a/docs/interfaces/Query_SQL_Interface/random.html +++ b/docs/interfaces/Query_SQLInterface/random.html @@ -42,7 +42,7 @@ Query
    • - SQL_Interface + SQLInterface
    • random
    @@ -59,12 +59,12 @@ Return
  • - Source + Source
  • -

    Query\SQL_Interface::random

    +

    Query\SQLInterface::random

    Get the sql for random ordering

      diff --git a/docs/interfaces/Query_SQL_Interface/sequence_list.html b/docs/interfaces/Query_SQLInterface/sequence_list.html similarity index 90% rename from docs/interfaces/Query_SQL_Interface/sequence_list.html rename to docs/interfaces/Query_SQLInterface/sequence_list.html index 3db692a..4a9f9a9 100644 --- a/docs/interfaces/Query_SQL_Interface/sequence_list.html +++ b/docs/interfaces/Query_SQLInterface/sequence_list.html @@ -42,7 +42,7 @@ Query
    • - SQL_Interface + SQLInterface
    • sequence_list
    @@ -59,12 +59,12 @@ Return
  • - Source + Source
  • -

    Query\SQL_Interface::sequence_list

    +

    Query\SQLInterface::sequence_list

    Return sql to list sequences

      diff --git a/docs/interfaces/Query_SQL_Interface/system_table_list.html b/docs/interfaces/Query_SQLInterface/system_table_list.html similarity index 90% rename from docs/interfaces/Query_SQL_Interface/system_table_list.html rename to docs/interfaces/Query_SQLInterface/system_table_list.html index b1766c8..1a7cad9 100644 --- a/docs/interfaces/Query_SQL_Interface/system_table_list.html +++ b/docs/interfaces/Query_SQLInterface/system_table_list.html @@ -42,7 +42,7 @@ Query
    • - SQL_Interface + SQLInterface
    • system_table_list
    @@ -59,12 +59,12 @@ Return
  • - Source + Source
  • -

    Query\SQL_Interface::system_table_list

    +

    Query\SQLInterface::system_table_list

    Returns sql to list system tables

      diff --git a/docs/interfaces/Query_SQL_Interface/table_list.html b/docs/interfaces/Query_SQLInterface/table_list.html similarity index 90% rename from docs/interfaces/Query_SQL_Interface/table_list.html rename to docs/interfaces/Query_SQLInterface/table_list.html index c1eab89..cfee559 100644 --- a/docs/interfaces/Query_SQL_Interface/table_list.html +++ b/docs/interfaces/Query_SQLInterface/table_list.html @@ -42,7 +42,7 @@ Query
    • - SQL_Interface + SQLInterface
    • table_list
    @@ -59,12 +59,12 @@ Return
  • - Source + Source
  • -

    Query\SQL_Interface::table_list

    +

    Query\SQLInterface::table_list

    Returns sql to list tables

      diff --git a/docs/interfaces/Query_SQL_Interface/trigger_list.html b/docs/interfaces/Query_SQLInterface/trigger_list.html similarity index 90% rename from docs/interfaces/Query_SQL_Interface/trigger_list.html rename to docs/interfaces/Query_SQLInterface/trigger_list.html index a7821ae..a5c99f5 100644 --- a/docs/interfaces/Query_SQL_Interface/trigger_list.html +++ b/docs/interfaces/Query_SQLInterface/trigger_list.html @@ -42,7 +42,7 @@ Query
    • - SQL_Interface + SQLInterface
    • trigger_list
    @@ -59,12 +59,12 @@ Return
  • - Source + Source
  • -

    Query\SQL_Interface::trigger_list

    +

    Query\SQLInterface::trigger_list

    Returns sql to list triggers

      diff --git a/docs/interfaces/Query_SQL_Interface/type_list.html b/docs/interfaces/Query_SQLInterface/type_list.html similarity index 90% rename from docs/interfaces/Query_SQL_Interface/type_list.html rename to docs/interfaces/Query_SQLInterface/type_list.html index f97f188..e4fdcb9 100644 --- a/docs/interfaces/Query_SQL_Interface/type_list.html +++ b/docs/interfaces/Query_SQLInterface/type_list.html @@ -42,7 +42,7 @@ Query
    • - SQL_Interface + SQLInterface
    • type_list
    @@ -59,12 +59,12 @@ Return
  • - Source + Source
  • -

    Query\SQL_Interface::type_list

    +

    Query\SQLInterface::type_list

    Return sql to list database field types

      diff --git a/docs/interfaces/Query_SQL_Interface/view_list.html b/docs/interfaces/Query_SQLInterface/view_list.html similarity index 90% rename from docs/interfaces/Query_SQL_Interface/view_list.html rename to docs/interfaces/Query_SQLInterface/view_list.html index 133950a..ec4afde 100644 --- a/docs/interfaces/Query_SQL_Interface/view_list.html +++ b/docs/interfaces/Query_SQLInterface/view_list.html @@ -42,7 +42,7 @@ Query
    • - SQL_Interface + SQLInterface
    • view_list
    @@ -59,12 +59,12 @@ Return
  • - Source + Source
  • -

    Query\SQL_Interface::view_list

    +

    Query\SQLInterface::view_list

    Returns sql to list views

      diff --git a/docs/source/Query/AbstractDriver.php.html b/docs/source/Query/AbstractDriver.php.html new file mode 100644 index 0000000..2efa09c --- /dev/null +++ b/docs/source/Query/AbstractDriver.php.html @@ -0,0 +1,3 @@ + +phpDox - Source of AbstractDriver.php

      Source of file AbstractDriver.php

      + Size: 15,192 Bytes - Last Modified: 2015-11-10T09:57:28-05:00

      ../src/Query/AbstractDriver.php

      123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670
      <?php
      /**
       * Query
       *
       * Free Query Builder / Database Abstraction Layer
       *
       * @package		Query
       * @author		Timothy J. Warren
       * @copyright	Copyright (c) 2012 - 2014
       * @link 		https://github.com/aviat4ion/Query
       * @license		http://philsturgeon.co.uk/code/dbad-license
       */

      // --------------------------------------------------------------------------

      namespace Query;

      // --------------------------------------------------------------------------

      /**
       * Base Database class
       *
       * Extends PDO to simplify cross-database issues
       *
       * @package Query
       * @subpackage Drivers
       */
      abstract class AbstractDriver extends \PDO implements DriverInterface {

      	/**
      	 * Reference to the last executed query
      	 * @var \PDOStatement
      	 */
      	protected $statement;

      	/**
      	 * Character to escape identifiers
      	 * @var string
      	 */
      	protected $escape_char = '"';

      	/**
      	 * Reference to sql class
      	 * @var SQL_Interface
      	 */
      	protected $sql;

      	/**
      	 * Reference to util class
      	 * @var Abstract_Util
      	 */
      	protected $util;

      	/**
      	 * Last query executed
      	 * @var string
      	 */
      	protected $last_query;

      	/**
      	 * Prefix to apply to table names
      	 * @var string
      	 */
      	protected $table_prefix = '';

      	/**
      	 * Whether the driver supports 'TRUNCATE'
      	 * @var bool
      	 */
      	protected $has_truncate = TRUE;

      	/**
      	 * PDO constructor wrapper
      	 *
      	 * @param string $dsn
      	 * @param string $username
      	 * @param string $password
      	 * @param array $driver_options
      	 */
      	public function __construct($dsn, $username=NULL, $password=NULL, array $driver_options=array())
      	{
      		// Set PDO to display errors as exceptions, and apply driver options
      		$driver_options[\PDO::ATTR_ERRMODE] = \PDO::ERRMODE_EXCEPTION;
      		parent::__construct($dsn, $username, $password, $driver_options);

      		$this->_load_sub_classes();
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Loads the subclasses for the driver
      	 *
      	 * @return void
      	 */
      	protected function _load_sub_classes()
      	{
      		// Load the sql and util class for the driver
      		$this_class = get_class($this);
      		$ns_array = explode("\\", $this_class);
      		array_pop($ns_array);
      		$driver = array_pop($ns_array);
      		$sql_class = "\\Query\\Drivers\\{$driver}\\SQL";
      		$util_class = "\\Query\\Drivers\\{$driver}\\Util";

      		$this->sql = new $sql_class();
      		$this->util = new $util_class($this);
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Allow invoke to work on table object
      	 *
      	 * @codeCoverageIgnore
      	 * @param string $name
      	 * @param array $args
      	 * @return mixed
      	 */
      	public function __call($name, $args = array())
      	{
      		if (
      			isset($this->$name)
      			&& is_object($this->$name)
      			&& method_exists($this->$name, '__invoke')
      		)
      		{
      			return call_user_func_array(array($this->$name, '__invoke'), $args);
      		}
      	}

      	// --------------------------------------------------------------------------
      	// ! Accessors / Mutators
      	// --------------------------------------------------------------------------

      	/**
      	 * Get the last sql query exexcuted
      	 *
      	 * @return string
      	 */
      	public function get_last_query()
      	{
      		return $this->last_query;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Set the last query sql
      	 *
      	 * @param string $query_string
      	 * @return void
      	 */
      	public function set_last_query($query_string)
      	{
      		$this->last_query = $query_string;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Get the SQL class for the current driver
      	 *
      	 * @return SQL_Interface
      	 */
      	public function get_sql()
      	{
      		return $this->sql;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Get the Util class for the current driver
      	 *
      	 * @return Abstract_Util
      	 */
      	public function get_util()
      	{
      		return $this->util;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Set the common table name prefix
      	 *
      	 * @param string $prefix
      	 * @return void
      	 */
      	public function set_table_prefix($prefix)
      	{
      		$this->table_prefix = $prefix;
      	}

      	// --------------------------------------------------------------------------
      	// ! Concrete functions that can be overridden in child classes
      	// --------------------------------------------------------------------------

      	/**
      	 * Simplifies prepared statements for database queries
      	 *
      	 * @param string $sql
      	 * @param array $data
      	 * @return \PDOStatement | FALSE
      	 * @throws \InvalidArgumentException
      	 */
      	public function prepare_query($sql, $data)
      	{
      		// Prepare the sql, save the statement for easy access later
      		$this->statement = $this->prepare($sql);

      		if( ! (is_array($data) || is_object($data)))
      		{
      			throw new \InvalidArgumentException("Invalid data argument");
      		}

      		// Bind the parameters
      		foreach($data as $k => $value)
      		{
      			// Parameters are 1-based, the data is 0-based
      			// So, if the key is numeric, add 1
      			if(is_numeric($k)) $k++;
      			$this->statement->bindValue($k, $value);
      		}

      		return $this->statement;
      	}

      	// -------------------------------------------------------------------------

      	/**
      	 * Create and execute a prepared statement with the provided parameters
      	 *
      	 * @param string $sql
      	 * @param array $params
      	 * @return \PDOStatement
      	 */
      	public function prepare_execute($sql, $params)
      	{
      		$this->statement = $this->prepare_query($sql, $params);
      		$this->statement->execute();

      		return $this->statement;
      	}

      	// -------------------------------------------------------------------------

      	/**
      	 * Returns number of rows affected by an INSERT, UPDATE, DELETE type query
      	 *
      	 * @return int
      	 */
      	public function affected_rows()
      	{
      		// Return number of rows affected
      		return $this->statement->rowCount();
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Prefixes a table if it is not already prefixed
      	 * @param string $table
      	 * @return string
      	 */
      	public function prefix_table($table)
      	{
      		// Add the prefix to the table name
      		// before quoting it
      		if ( ! empty($this->table_prefix))
      		{
      			// Split identifier by period, will split into:
      			// database.schema.table OR
      			// schema.table OR
      			// database.table OR
      			// table
      			$idents = explode('.', $table);
      			$segments = count($idents);

      			// Quote the last item, and add the database prefix
      			$idents[$segments - 1] = $this->_prefix(end($idents));

      			// Rejoin
      			$table = implode('.', $idents);
      		}

      		return $table;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Quote database table name, and set prefix
      	 *
      	 * @param string $table
      	 * @return string
      	 */
      	public function quote_table($table)
      	{
      		$table = $this->prefix_table($table);

      		// Finally, quote the table
      		return $this->quote_ident($table);
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Surrounds the string with the databases identifier escape characters
      	 *
      	 * @param mixed $ident
      	 * @return string
      	 */
      	public function quote_ident($ident)
      	{
      		if (is_array($ident))
      		{
      			return array_map(array($this, __METHOD__), $ident);
      		}

      		// Handle comma-separated identifiers
      		if (strpos($ident, ',') !== FALSE)
      		{
      			$parts = array_map('mb_trim', explode(',', $ident));
      			$parts = array_map(array($this, __METHOD__), $parts);
      			$ident = implode(',', $parts);
      		}

      		// Split each identifier by the period
      		$hiers = explode('.', $ident);
      		$hiers = array_map('mb_trim', $hiers);

      		// Re-compile the string
      		$raw = implode('.', array_map(array($this, '_quote'), $hiers));

      		// Fix functions
      		$funcs = array();
      		preg_match_all("#{$this->escape_char}([a-zA-Z0-9_]+(\((.*?)\))){$this->escape_char}#iu", $raw, $funcs, PREG_SET_ORDER);
      		foreach($funcs as $f)
      		{
      			// Unquote the function
      			$raw = str_replace($f[0], $f[1], $raw);

      			// Quote the inside identifiers
      			$raw = str_replace($f[3], $this->quote_ident($f[3]), $raw);
      		}

      		return $raw;

      	}

      	// -------------------------------------------------------------------------

      	/**
      	 * Return schemas for databases that list them
      	 *
      	 * @return array
      	 */
      	public function get_schemas()
      	{
      		return NULL;
      	}

      	// -------------------------------------------------------------------------

      	/**
      	 * Return list of tables for the current database
      	 *
      	 * @return array
      	 */
      	public function get_tables()
      	{
      		$tables = $this->driver_query('table_list');
      		natsort($tables);
      		return $tables;
      	}

      	// -------------------------------------------------------------------------

      	/**
      	 * Return list of dbs for the current connection, if possible
      	 *
      	 * @return array
      	 */
      	public function get_dbs()
      	{
      		return $this->driver_query('db_list');
      	}

      	// -------------------------------------------------------------------------

      	/**
      	 * Return list of views for the current database
      	 *
      	 * @return array
      	 */
      	public function get_views()
      	{
      		$views = $this->driver_query('view_list');
      		sort($views);
      		return $views;
      	}

      	// -------------------------------------------------------------------------

      	/**
      	 * Return list of sequences for the current database, if they exist
      	 *
      	 * @return array
      	 */
      	public function get_sequences()
      	{
      		return $this->driver_query('sequence_list');
      	}

      	// -------------------------------------------------------------------------

      	/**
      	 * Return list of functions for the current database
      	 *
      	 * @return array
      	 */
      	public function get_functions()
      	{
      		return $this->driver_query('function_list', FALSE);
      	}

      	// -------------------------------------------------------------------------

      	/**
      	 * Return list of stored procedures for the current database
      	 *
      	 * @return array
      	 */
      	public function get_procedures()
      	{
      		return $this->driver_query('procedure_list', FALSE);
      	}

      	// -------------------------------------------------------------------------

      	/**
      	 * Return list of triggers for the current database
      	 *
      	 * @return array
      	 */
      	public function get_triggers()
      	{
      		return $this->driver_query('trigger_list', FALSE);
      	}

      	// -------------------------------------------------------------------------

      	/**
      	 * Retrieves an array of non-user-created tables for
      	 * the connection/database
      	 *
      	 * @return array
      	 */
      	public function get_system_tables()
      	{
      		return $this->driver_query('system_table_list');
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Retrieve column information for the current database table
      	 *
      	 * @param string $table
      	 * @return array
      	 */
      	public function get_columns($table)
      	{
      		return $this->driver_query($this->get_sql()->column_list($this->prefix_table($table)), FALSE);
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Retrieve foreign keys for the table
      	 *
      	 * @param string $table
      	 * @return array
      	 */
      	public function get_fks($table)
      	{
      		return $this->driver_query($this->get_sql()->fk_list($table), FALSE);
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Retrieve indexes for the table
      	 *
      	 * @param string $table
      	 * @return array
      	 */
      	public function get_indexes($table)
      	{
      		return $this->driver_query($this->get_sql()->index_list($this->prefix_table($table)), FALSE);
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Retrieve list of data types for the database
      	 *
      	 * @return array
      	 */
      	public function get_types()
      	{
      		return $this->driver_query('type_list', FALSE);
      	}

      	// -------------------------------------------------------------------------

      	/**
      	 * Method to simplify retrieving db results for meta-data queries
      	 *
      	 * @param string|array|null $query
      	 * @param bool $filtered_index
      	 * @return array
      	 */
      	public function driver_query($query, $filtered_index=TRUE)
      	{
      		// Call the appropriate method, if it exists
      		if (is_string($query) && method_exists($this->sql, $query))
      		{
      			$query = $this->get_sql()->$query();
      		}

      		// Return if the values are returned instead of a query,
      		// or if the query doesn't apply to the driver
      		if ( ! is_string($query)) return $query;

      		// Run the query!
      		$res = $this->query($query);

      		$flag = ($filtered_index) ? \PDO::FETCH_NUM : \PDO::FETCH_ASSOC;
      		$all = $res->fetchAll($flag);

      		return ($filtered_index) ? \db_filter($all, 0) : $all;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Return the number of rows returned for a SELECT query
      	 *
      	 * @see http://us3.php.net/manual/en/pdostatement.rowcount.php#87110
      	 * @return int
      	 */
      	public function num_rows()
      	{
      		$regex = '/^SELECT\s+(?:ALL\s+|DISTINCT\s+)?(?:.*?)\s+FROM\s+(.*)$/i';
      		$output = array();

      		if (preg_match($regex, $this->last_query, $output) > 0)
      		{
      			$stmt = $this->query("SELECT COUNT(*) FROM {$output[1]}");
      			return (int) $stmt->fetchColumn();
      		}

      		return NULL;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Create sql for batch insert
      	 *
      	 * @param string $table
      	 * @param array $data
      	 * @return null|array<string|array|null>
      	 */
      	public function insert_batch($table, $data=array())
      	{
      		$first_row = current($data);
      		if ( ! is_array($first_row)) return NULL;

      		// Values for insertion
      		$vals = array();
      		foreach($data as $group)
      		{
      			$vals = array_merge($vals, array_values($group));
      		}
      		$table = $this->quote_table($table);
      		$fields = array_keys($first_row);

      		$sql = "INSERT INTO {$table} ("
      			. implode(',', $this->quote_ident($fields))
      			. ") VALUES ";

      		// Create the placeholder groups
      		$params = array_fill(0, count($fields), '?');
      		$param_string = "(" . implode(',', $params) . ")";
      		$param_list = array_fill(0, count($data), $param_string);

      		// Append the placeholder groups to the query
      		$sql .= implode(',', $param_list);

      		return array($sql, $vals);
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Helper method for quote_ident
      	 *
      	 * @param mixed $str
      	 * @return mixed
      	 */
      	public function _quote($str)
      	{
      		// Check that the current value is a string,
      		// and is not already quoted before quoting
      		// that value, otherwise, return the original value
      		return (
      			is_string($str)
      			&& strpos($str, $this->escape_char) !== 0
      			&& strrpos($str, $this->escape_char) !== 0
      		)
      			? "{$this->escape_char}{$str}{$this->escape_char}"
      			: $str;

      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Sets the table prefix on the passed string
      	 *
      	 * @param string $str
      	 * @return string
      	 */
      	protected function _prefix($str)
      	{
      		// Don't prefix an already prefixed table
      		if (strpos($str, $this->table_prefix) !== FALSE)
      		{
      			return $str;
      		}

      		return $this->table_prefix.$str;
      	}

      	// -------------------------------------------------------------------------

      	/**
      	 * Empty the passed table
      	 *
      	 * @param string $table
      	 * @return \PDOStatement
      	 */
      	public function truncate($table)
      	{
      		$sql = ($this->has_truncate)
      			? 'TRUNCATE '
      			: 'DELETE FROM ';

      		$sql .= $this->quote_table($table);

      		$this->statement = $this->query($sql);
      		return $this->statement;
      	}

      }
      // End of db_pdo.php
      Generated using phpDox 0.8.2-dev - Copyright (C) 2010 - 2015 by Arne Blankerts
      diff --git a/docs/source/Query/AbstractQueryBuilder.php.html b/docs/source/Query/AbstractQueryBuilder.php.html new file mode 100644 index 0000000..de81c0b --- /dev/null +++ b/docs/source/Query/AbstractQueryBuilder.php.html @@ -0,0 +1,3 @@ + +phpDox - Source of AbstractQueryBuilder.php

      Source of file AbstractQueryBuilder.php

      + Size: 13,376 Bytes - Last Modified: 2015-11-10T09:57:49-05:00

      ../src/Query/AbstractQueryBuilder.php

      123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622
      <?php
      /**
       * Query
       *
       * Free Query Builder / Database Abstraction Layer
       *
       * @package		Query
       * @author		Timothy J. Warren
       * @copyright	Copyright (c) 2012 - 2014
       * @link 		https://github.com/aviat4ion/Query
       * @license		http://philsturgeon.co.uk/code/dbad-license
       */

      // --------------------------------------------------------------------------

      namespace Query;

      // --------------------------------------------------------------------------

      /**
       * Abstract Class for internal implementation methods of the Query Builder
       * @package Query
       */
      abstract class AbstractQueryBuilder {

      	// --------------------------------------------------------------------------
      	// ! Constants
      	// --------------------------------------------------------------------------

      	const KEY 	= 0;
      	const VALUE = 1;
      	const BOTH 	= 2;


      	// --------------------------------------------------------------------------
      	// ! 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 string
      	 */
      	protected $limit;

      	/**
      	 * Value for offset in limit string
      	 * @var 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
      	 * @var Driver_Interface
      	 */
      	public $db;

      	/**
      	 * Query parser class instance
      	 * @var Query_Parser
      	 */
      	public $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
      	// --------------------------------------------------------------------------

      	/**
      	 * Set values in the class, with either an array or key value pair
      	 *
      	 * @param array $var
      	 * @param mixed $key
      	 * @param mixed $val
      	 * @param int $val_type
      	 * @return array
      	 */
      	protected function _mixed_set(&$var, $key, $val=NULL, $val_type=self::BOTH)
      	{
      		$arg = (is_scalar($key) && is_scalar($val))
      			? array($key => $val)
      			: $key;

      		foreach($arg as $k => $v)
      		{
      			if (in_array($val_type, array(self::KEY, self::VALUE)))
      			{
      				$var[] = ($val_type === self::KEY)
      					? $k
      					: $v;
      			}
      			else
      			{
      				$var[$k] = $v;
      			}
      		}

      		return $var;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Method to simplify select_ methods
      	 *
      	 * @param string $field
      	 * @param string|bool $as
      	 * @return string
      	 */
      	protected function _select($field, $as = FALSE)
      	{
      		// Escape the identifiers
      		$field = $this->db->quote_ident($field);

      		if ( ! is_string($as)) return $field;


      		$as = $this->db->quote_ident($as);
      		return "({$field}) AS {$as} ";
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Helper function for returning sql strings
      	 *
      	 * @param string $type
      	 * @param string $table
      	 * @param bool $reset
      	 * @return string
      	 */
      	protected function _get_compile($type, $table, $reset)
      	{
      		$sql = $this->_compile($type, $table);

      		// Reset the query builder for the next query
      		if ($reset) $this->reset_query();

      		return $sql;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Simplify 'like' methods
      	 *
      	 * @param string $field
      	 * @param mixed $val
      	 * @param string $pos
      	 * @param string $like
      	 * @param string $conj
      	 * @return Query_Builder
      	 */
      	protected function _like($field, $val, $pos, $like='LIKE', $conj='AND')
      	{
      		$field = $this->db->quote_ident($field);

      		// Add the like string into the order map
      		$like = $field. " {$like} ?";

      		if ($pos == 'before')
      		{
      			$val = "%{$val}";
      		}
      		elseif ($pos == 'after')
      		{
      			$val = "{$val}%";
      		}
      		else
      		{
      			$val = "%{$val}%";
      		}

      		$conj = (empty($this->query_map)) ? ' WHERE ' : " {$conj} ";
      		$this->_append_map($conj, $like, 'like');

      		// Add to the values array
      		$this->where_values[] = $val;

      		return $this;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Simplify building having clauses
      	 *
      	 * @param mixed $key
      	 * @param mixed $val
      	 * @param string $conj
      	 * @return Query_Builder
      	 */
      	protected function _having($key, $val=array(), $conj='AND')
      	{
      		$where = $this->_where($key, $val);

      		// Create key/value placeholders
      		foreach($where as $f => $val)
      		{
      			// Split each key by spaces, in case there
      			// is an operator such as >, <, !=, etc.
      			$f_array = explode(' ', trim($f));

      			$item = $this->db->quote_ident($f_array[0]);

      			// Simple key value, or an operator
      			$item .= (count($f_array) === 1) ? '=?' : " {$f_array[1]} ?";

      			// Put in the having map
      			$this->having_map[] = array(
      				'conjunction' => ( ! empty($this->having_map)) ? " {$conj} " : ' HAVING ',
      				'string' => $item
      			);
      		}

      		return $this;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Do all the repeditive stuff for where/having type methods
      	 *
      	 * @param mixed $key
      	 * @param mixed $val
      	 * @return array
      	 */
      	protected function _where($key, $val=array())
      	{
      		$where = array();
      		$this->_mixed_set($where, $key, $val, self::BOTH);
      		$this->_mixed_set($this->where_values, $key, $val, self::VALUE);
      		return $where;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Simplify generating where string
      	 *
      	 * @param mixed $key
      	 * @param mixed $val
      	 * @param string $defaultConj
      	 * @return Query_Builder
      	 */
      	protected function _where_string($key, $val=array(), $defaultConj='AND')
      	{
      		// Create key/value placeholders
      		foreach($this->_where($key, $val) as $f => $val)
      		{
      			// Split each key by spaces, in case there
      			// is an operator such as >, <, !=, etc.
      			$f_array = explode(' ', trim($f));

      			$item = $this->db->quote_ident($f_array[0]);

      			// Simple key value, or an operator
      			$item .= (count($f_array) === 1) ? '=?' : " {$f_array[1]} ?";
      			$last_item = end($this->query_map);

      			// Determine the correct conjunction
      			$conjunctionList = array_pluck($this->query_map, 'conjunction');
      			if (empty($this->query_map) || ( ! regex_in_array($conjunctionList, "/^ ?\n?WHERE/i")))
      			{
      				$conj = "\nWHERE ";
      			}
      			elseif ($last_item['type'] === 'group_start')
      			{
      				$conj = '';
      			}
      			else
      			{
      				$conj = " {$defaultConj} ";
      			}

      			$this->_append_map($conj, $item, 'where');
      		}

      		return $this;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Simplify where_in methods
      	 *
      	 * @param mixed $key
      	 * @param mixed $val
      	 * @param string $in - The (not) in fragment
      	 * @param string $conj - The where in conjunction
      	 * @return Query_Builder
      	 */
      	protected function _where_in($key, $val=array(), $in='IN', $conj='AND')
      	{
      		$key = $this->db->quote_ident($key);
      		$params = array_fill(0, count($val), '?');

      		foreach($val as $v)
      		{
      			$this->where_values[] = $v;
      		}

      		$conjunction = ( ! empty($this->query_map)) ? " {$conj} " : ' WHERE ';
      		$str = $key . " {$in} (".implode(',', $params).') ';

      		$this->_append_map($conjunction, $str, 'where_in');

      		return $this;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Executes the compiled query
      	 *
      	 * @param string $type
      	 * @param string $table
      	 * @param string $sql
      	 * @param array|null $vals
      	 * @return \PDOStatement
      	 */
      	protected function _run($type, $table, $sql=NULL, $vals=NULL)
      	{
      		if (is_null($sql))
      		{
      			$sql = $this->_compile($type, $table);
      		}

      		if (is_null($vals))
      		{
      			$vals = array_merge($this->values, (array) $this->where_values);
      		}

      		$start_time = microtime(TRUE);

      		$res = (empty($vals))
      			? $this->db->query($sql)
      			: $this->db->prepare_execute($sql, $vals);

      		$end_time = microtime(TRUE);
      		$total_time = number_format($end_time - $start_time, 5);

      		// Add this query to the list of executed queries
      		$this->_append_query($vals, $sql, $total_time);

      		// Reset class state for next query
      		$this->reset_query();

      		return $res;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Add an additional set of mapping pairs to a internal map
      	 *
      	 * @param string $conjunction
      	 * @param string $string
      	 * @param string $type
      	 * @return void
      	 */
      	protected function _append_map($conjunction = '', $string = '', $type = '')
      	{
      		array_push($this->query_map, array(
      			'type' => $type,
      			'conjunction' => $conjunction,
      			'string' => $string
      		));
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Convert the prepared statement into readable sql
      	 *
      	 * @param array $vals
      	 * @param string $sql
      	 * @param string $total_time
      	 * @return void
      	 */
      	protected function _append_query($vals, $sql, $total_time)
      	{
      		$evals = (is_array($vals)) ? $vals : array();
      		$esql = str_replace('?', "%s", $sql);

      		// Quote string values
      		foreach($evals as &$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
      		// as arguments to sprintf
      		array_unshift($evals, $esql);

      		// Add the interpreted query to the list of executed queries
      		$this->queries[] = array(
      			'time' => $total_time,
      			'sql' => call_user_func_array('sprintf', $evals),
      		);

      		$this->queries['total_time'] += $total_time;

      		// Set the last query to get rowcounts properly
      		$this->db->set_last_query($sql);
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Sub-method for generating sql strings
      	 *
      	 * @param string $type
      	 * @param string $table
      	 * @return string
      	 */
      	protected function _compile_type($type='', $table='')
      	{
      		if ($type === 'insert')
      		{
      			$param_count = count($this->set_array_keys);
      			$params = array_fill(0, $param_count, '?');
      			$sql = "INSERT INTO {$table} ("
      				. implode(',', $this->set_array_keys)
      				. ")\nVALUES (".implode(',', $params).')';
      		}
      		elseif ($type === 'update')
      		{
      			$sql = "UPDATE {$table}\nSET {$this->set_string}";
      		}
      		elseif ($type === 'delete')
      		{
      			$sql = "DELETE FROM {$table}";
      		}
      		else // GET queries
      		{
      			$sql = "SELECT * \nFROM {$this->from_string}";

      			// Set the select string
      			if ( ! empty($this->select_string))
      			{
      				// Replace the star with the selected fields
      				$sql = str_replace('*', $this->select_string, $sql);
      			}
      		}

      		return $sql;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * String together the sql statements for sending to the db
      	 *
      	 * @param string $type
      	 * @param string $table
      	 * @return string
      	 */
      	protected function _compile($type='', $table='')
      	{
      		// Get the base clause for the query
      		$sql = $this->_compile_type($type, $this->db->quote_table($table));

      		$clauses = array(
      			'query_map',
      			'group_string',
      			'order_string',
      			'having_map',
      		);

      		// Set each type of subclause
      		foreach($clauses as $clause)
      		{
      			$param = $this->$clause;
      			if (is_array($param))
      			{
      				foreach($param as $q)
      				{
      					$sql .= $q['conjunction'] . $q['string'];
      				}
      			}
      			else
      			{
      				$sql .= $param;
      			}
      		}

      		// Set the limit via the class variables
      		if (is_numeric($this->limit))
      		{
      			$sql = $this->sql->limit($sql, $this->limit, $this->offset);
      		}

      		// See if the query plan, rather than the
      		// query data should be returned
      		if ($this->explain === TRUE)
      		{
      			$sql = $this->sql->explain($sql);
      		}

      		return $sql;
      	}
      }

      // End of abstract_query_builder.php
      Generated using phpDox 0.8.2-dev - Copyright (C) 2010 - 2015 by Arne Blankerts
      diff --git a/docs/source/Query/AbstractSQL.php.html b/docs/source/Query/AbstractSQL.php.html new file mode 100644 index 0000000..169fc80 --- /dev/null +++ b/docs/source/Query/AbstractSQL.php.html @@ -0,0 +1,3 @@ + +phpDox - Source of AbstractSQL.php

      Source of file AbstractSQL.php

      + Size: 0,847 Bytes - Last Modified: 2015-11-10T10:03:56-05:00

      ../src/Query/AbstractSQL.php

      1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
      <?php
      /**
       * Query
       *
       * Free Query Builder / Database Abstraction Layer
       *
       * @author		Timothy J. Warren
       * @copyright	Copyright (c) 2012 - 2014
       * @link 		https://github.com/aviat4ion/Query
       * @license		http://philsturgeon.co.uk/code/dbad-license
       * @package		Query
       */

      // --------------------------------------------------------------------------

      namespace Query;

      /**
       * parent for database manipulation subclasses
       *
       * @package Query
       * @subpackage Drivers
       */
      abstract class AbstractSQL implements SQLInterface {

      	/**
      	 * Limit clause
      	 *
      	 * @param string $sql
      	 * @param int $limit
      	 * @param int|bool $offset
      	 * @return string
      	 */
      	public function limit($sql, $limit, $offset=FALSE)
      	{
      		$sql .= "\nLIMIT {$limit}";

      		if (is_numeric($offset))
      		{
      			$sql .= " OFFSET {$offset}";
      		}

      		return $sql;
      	}
      }
      // End of abstract_sql.php

      Generated using phpDox 0.8.2-dev - Copyright (C) 2010 - 2015 by Arne Blankerts
      diff --git a/docs/source/Query/AbstractUtil.php.html b/docs/source/Query/AbstractUtil.php.html new file mode 100644 index 0000000..df6158d --- /dev/null +++ b/docs/source/Query/AbstractUtil.php.html @@ -0,0 +1,3 @@ + +phpDox - Source of AbstractUtil.php

      Source of file AbstractUtil.php

      + Size: 3,320 Bytes - Last Modified: 2015-11-10T10:04:06-05:00

      ../src/Query/AbstractUtil.php

      123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
      <?php
      /**
       * Query
       *
       * Free Query Builder / Database Abstraction Layer
       *
       * @package		Query
       * @author		Timothy J. Warren
       * @copyright	Copyright (c) 2012 - 2014
       * @link 		https://github.com/aviat4ion/Query
       * @license		http://philsturgeon.co.uk/code/dbad-license
       */

      // --------------------------------------------------------------------------

      namespace Query;

      // --------------------------------------------------------------------------

      /**
       * Abstract class defining database / table creation methods
       *
       * @package Query
       * @subpackage Drivers
       * @method string quote_ident(string $sql)
       * @method string quote_table(string $sql)
       */
      abstract class AbstractUtil {

      	/**
      	 * Reference to the current connection object
      	 */
      	private $conn;

      	/**
      	 * Save a reference to the connection object for later use
      	 *
      	 * @param Driver_Interface $conn
      	 */
      	public function __construct(DriverInterface $conn)
      	{
      		$this->conn = $conn;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Get the driver object for the current connection
      	 *
      	 * @return Driver_Interface
      	 */
      	public function get_driver()
      	{
      		return $this->conn;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Convenience public function to generate sql for creating a db table
      	 *
      	 * @param string $name
      	 * @param array $fields
      	 * @param array $constraints
      	 * @param bool $if_not_exists
      	 * @return string
      	 */
      	public function create_table($name, $fields, array $constraints=array(), $if_not_exists=TRUE)
      	{
      		$exists_str = ($if_not_exists) ? ' IF NOT EXISTS ' : ' ';

      		// Reorganize into an array indexed with column information
      		// Eg $column_array[$colname] = array(
      		// 		'type' => ...,
      		// 		'constraint' => ...,
      		// 		'index' => ...,
      		// )
      		$column_array = \array_zipper(array(
      			'type' => $fields,
      			'constraint' => $constraints
      		));

      		// Join column definitions together
      		$columns = array();
      		foreach($column_array as $n => $props)
      		{
      			$str = $this->get_driver()->quote_ident($n);
      			$str .= (isset($props['type'])) ? " {$props['type']}" : "";
      			$str .= (isset($props['constraint'])) ? " {$props['constraint']}" : "";

      			$columns[] = $str;
      		}

      		// Generate the sql for the creation of the table
      		$sql = 'CREATE TABLE'.$exists_str.$this->get_driver()->quote_table($name).' (';
      		$sql .= implode(', ', $columns);
      		$sql .= ')';

      		return $sql;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Drop the selected table
      	 *
      	 * @param string $name
      	 * @return string
      	 */
      	public function delete_table($name)
      	{
      		return 'DROP TABLE IF EXISTS '.$this->get_driver()->quote_table($name);
      	}


      	// --------------------------------------------------------------------------
      	// ! Abstract Methods
      	// --------------------------------------------------------------------------

      	/**
      	 * Return an SQL file with the database table structure
      	 *
      	 * @abstract
      	 * @return string
      	 */
      	abstract public function backup_structure();

      	// --------------------------------------------------------------------------

      	/**
      	 * Return an SQL file with the database data as insert statements
      	 *
      	 * @abstract
      	 * @return string
      	 */
      	abstract public function backup_data();

      }
      // End of abstract_util.php
      Generated using phpDox 0.8.2-dev - Copyright (C) 2010 - 2015 by Arne Blankerts
      diff --git a/docs/source/Query/Abstract_Driver.php.html b/docs/source/Query/Abstract_Driver.php.html deleted file mode 100644 index 0ed135b..0000000 --- a/docs/source/Query/Abstract_Driver.php.html +++ /dev/null @@ -1,3 +0,0 @@ - -phpDox - Source of Abstract_Driver.php

      Source of file Abstract_Driver.php

      - Size: 15,194 Bytes - Last Modified: 2015-07-31T10:55:47-04:00

      ../src/Query/Abstract_Driver.php

      123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670
      <?php
      /**
       * Query
       *
       * Free Query Builder / Database Abstraction Layer
       *
       * @package		Query
       * @author		Timothy J. Warren
       * @copyright	Copyright (c) 2012 - 2014
       * @link 		https://github.com/aviat4ion/Query
       * @license		http://philsturgeon.co.uk/code/dbad-license
       */

      // --------------------------------------------------------------------------

      namespace Query;

      // --------------------------------------------------------------------------

      /**
       * Base Database class
       *
       * Extends PDO to simplify cross-database issues
       *
       * @package Query
       * @subpackage Drivers
       */
      abstract class Abstract_Driver extends \PDO implements Driver_Interface {

      	/**
      	 * Reference to the last executed query
      	 * @var \PDOStatement
      	 */
      	protected $statement;

      	/**
      	 * Character to escape identifiers
      	 * @var string
      	 */
      	protected $escape_char = '"';

      	/**
      	 * Reference to sql class
      	 * @var SQL_Interface
      	 */
      	protected $sql;

      	/**
      	 * Reference to util class
      	 * @var Abstract_Util
      	 */
      	protected $util;

      	/**
      	 * Last query executed
      	 * @var string
      	 */
      	protected $last_query;

      	/**
      	 * Prefix to apply to table names
      	 * @var string
      	 */
      	protected $table_prefix = '';

      	/**
      	 * Whether the driver supports 'TRUNCATE'
      	 * @var bool
      	 */
      	protected $has_truncate = TRUE;

      	/**
      	 * PDO constructor wrapper
      	 *
      	 * @param string $dsn
      	 * @param string $username
      	 * @param string $password
      	 * @param array $driver_options
      	 */
      	public function __construct($dsn, $username=NULL, $password=NULL, array $driver_options=array())
      	{
      		// Set PDO to display errors as exceptions, and apply driver options
      		$driver_options[\PDO::ATTR_ERRMODE] = \PDO::ERRMODE_EXCEPTION;
      		parent::__construct($dsn, $username, $password, $driver_options);

      		$this->_load_sub_classes();
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Loads the subclasses for the driver
      	 *
      	 * @return void
      	 */
      	protected function _load_sub_classes()
      	{
      		// Load the sql and util class for the driver
      		$this_class = get_class($this);
      		$ns_array = explode("\\", $this_class);
      		array_pop($ns_array);
      		$driver = array_pop($ns_array);
      		$sql_class = "\\Query\\Drivers\\{$driver}\\SQL";
      		$util_class = "\\Query\\Drivers\\{$driver}\\Util";

      		$this->sql = new $sql_class();
      		$this->util = new $util_class($this);
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Allow invoke to work on table object
      	 *
      	 * @codeCoverageIgnore
      	 * @param string $name
      	 * @param array $args
      	 * @return mixed
      	 */
      	public function __call($name, $args = array())
      	{
      		if (
      			isset($this->$name)
      			&& is_object($this->$name)
      			&& method_exists($this->$name, '__invoke')
      		)
      		{
      			return call_user_func_array(array($this->$name, '__invoke'), $args);
      		}
      	}

      	// --------------------------------------------------------------------------
      	// ! Accessors / Mutators
      	// --------------------------------------------------------------------------

      	/**
      	 * Get the last sql query exexcuted
      	 *
      	 * @return string
      	 */
      	public function get_last_query()
      	{
      		return $this->last_query;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Set the last query sql
      	 *
      	 * @param string $query_string
      	 * @return void
      	 */
      	public function set_last_query($query_string)
      	{
      		$this->last_query = $query_string;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Get the SQL class for the current driver
      	 *
      	 * @return SQL_Interface
      	 */
      	public function get_sql()
      	{
      		return $this->sql;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Get the Util class for the current driver
      	 *
      	 * @return Abstract_Util
      	 */
      	public function get_util()
      	{
      		return $this->util;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Set the common table name prefix
      	 *
      	 * @param string $prefix
      	 * @return void
      	 */
      	public function set_table_prefix($prefix)
      	{
      		$this->table_prefix = $prefix;
      	}

      	// --------------------------------------------------------------------------
      	// ! Concrete functions that can be overridden in child classes
      	// --------------------------------------------------------------------------

      	/**
      	 * Simplifies prepared statements for database queries
      	 *
      	 * @param string $sql
      	 * @param array $data
      	 * @return \PDOStatement | FALSE
      	 * @throws \InvalidArgumentException
      	 */
      	public function prepare_query($sql, $data)
      	{
      		// Prepare the sql, save the statement for easy access later
      		$this->statement = $this->prepare($sql);

      		if( ! (is_array($data) || is_object($data)))
      		{
      			throw new \InvalidArgumentException("Invalid data argument");
      		}

      		// Bind the parameters
      		foreach($data as $k => $value)
      		{
      			// Parameters are 1-based, the data is 0-based
      			// So, if the key is numeric, add 1
      			if(is_numeric($k)) $k++;
      			$this->statement->bindValue($k, $value);
      		}

      		return $this->statement;
      	}

      	// -------------------------------------------------------------------------

      	/**
      	 * Create and execute a prepared statement with the provided parameters
      	 *
      	 * @param string $sql
      	 * @param array $params
      	 * @return \PDOStatement
      	 */
      	public function prepare_execute($sql, $params)
      	{
      		$this->statement = $this->prepare_query($sql, $params);
      		$this->statement->execute();

      		return $this->statement;
      	}

      	// -------------------------------------------------------------------------

      	/**
      	 * Returns number of rows affected by an INSERT, UPDATE, DELETE type query
      	 *
      	 * @return int
      	 */
      	public function affected_rows()
      	{
      		// Return number of rows affected
      		return $this->statement->rowCount();
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Prefixes a table if it is not already prefixed
      	 * @param string $table
      	 * @return string
      	 */
      	public function prefix_table($table)
      	{
      		// Add the prefix to the table name
      		// before quoting it
      		if ( ! empty($this->table_prefix))
      		{
      			// Split identifier by period, will split into:
      			// database.schema.table OR
      			// schema.table OR
      			// database.table OR
      			// table
      			$idents = explode('.', $table);
      			$segments = count($idents);

      			// Quote the last item, and add the database prefix
      			$idents[$segments - 1] = $this->_prefix(end($idents));

      			// Rejoin
      			$table = implode('.', $idents);
      		}

      		return $table;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Quote database table name, and set prefix
      	 *
      	 * @param string $table
      	 * @return string
      	 */
      	public function quote_table($table)
      	{
      		$table = $this->prefix_table($table);

      		// Finally, quote the table
      		return $this->quote_ident($table);
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Surrounds the string with the databases identifier escape characters
      	 *
      	 * @param mixed $ident
      	 * @return string
      	 */
      	public function quote_ident($ident)
      	{
      		if (is_array($ident))
      		{
      			return array_map(array($this, __METHOD__), $ident);
      		}

      		// Handle comma-separated identifiers
      		if (strpos($ident, ',') !== FALSE)
      		{
      			$parts = array_map('mb_trim', explode(',', $ident));
      			$parts = array_map(array($this, __METHOD__), $parts);
      			$ident = implode(',', $parts);
      		}

      		// Split each identifier by the period
      		$hiers = explode('.', $ident);
      		$hiers = array_map('mb_trim', $hiers);

      		// Re-compile the string
      		$raw = implode('.', array_map(array($this, '_quote'), $hiers));

      		// Fix functions
      		$funcs = array();
      		preg_match_all("#{$this->escape_char}([a-zA-Z0-9_]+(\((.*?)\))){$this->escape_char}#iu", $raw, $funcs, PREG_SET_ORDER);
      		foreach($funcs as $f)
      		{
      			// Unquote the function
      			$raw = str_replace($f[0], $f[1], $raw);

      			// Quote the inside identifiers
      			$raw = str_replace($f[3], $this->quote_ident($f[3]), $raw);
      		}

      		return $raw;

      	}

      	// -------------------------------------------------------------------------

      	/**
      	 * Return schemas for databases that list them
      	 *
      	 * @return array
      	 */
      	public function get_schemas()
      	{
      		return NULL;
      	}

      	// -------------------------------------------------------------------------

      	/**
      	 * Return list of tables for the current database
      	 *
      	 * @return array
      	 */
      	public function get_tables()
      	{
      		$tables = $this->driver_query('table_list');
      		natsort($tables);
      		return $tables;
      	}

      	// -------------------------------------------------------------------------

      	/**
      	 * Return list of dbs for the current connection, if possible
      	 *
      	 * @return array
      	 */
      	public function get_dbs()
      	{
      		return $this->driver_query('db_list');
      	}

      	// -------------------------------------------------------------------------

      	/**
      	 * Return list of views for the current database
      	 *
      	 * @return array
      	 */
      	public function get_views()
      	{
      		$views = $this->driver_query('view_list');
      		sort($views);
      		return $views;
      	}

      	// -------------------------------------------------------------------------

      	/**
      	 * Return list of sequences for the current database, if they exist
      	 *
      	 * @return array
      	 */
      	public function get_sequences()
      	{
      		return $this->driver_query('sequence_list');
      	}

      	// -------------------------------------------------------------------------

      	/**
      	 * Return list of functions for the current database
      	 *
      	 * @return array
      	 */
      	public function get_functions()
      	{
      		return $this->driver_query('function_list', FALSE);
      	}

      	// -------------------------------------------------------------------------

      	/**
      	 * Return list of stored procedures for the current database
      	 *
      	 * @return array
      	 */
      	public function get_procedures()
      	{
      		return $this->driver_query('procedure_list', FALSE);
      	}

      	// -------------------------------------------------------------------------

      	/**
      	 * Return list of triggers for the current database
      	 *
      	 * @return array
      	 */
      	public function get_triggers()
      	{
      		return $this->driver_query('trigger_list', FALSE);
      	}

      	// -------------------------------------------------------------------------

      	/**
      	 * Retrieves an array of non-user-created tables for
      	 * the connection/database
      	 *
      	 * @return array
      	 */
      	public function get_system_tables()
      	{
      		return $this->driver_query('system_table_list');
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Retrieve column information for the current database table
      	 *
      	 * @param string $table
      	 * @return array
      	 */
      	public function get_columns($table)
      	{
      		return $this->driver_query($this->get_sql()->column_list($this->prefix_table($table)), FALSE);
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Retrieve foreign keys for the table
      	 *
      	 * @param string $table
      	 * @return array
      	 */
      	public function get_fks($table)
      	{
      		return $this->driver_query($this->get_sql()->fk_list($table), FALSE);
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Retrieve indexes for the table
      	 *
      	 * @param string $table
      	 * @return array
      	 */
      	public function get_indexes($table)
      	{
      		return $this->driver_query($this->get_sql()->index_list($this->prefix_table($table)), FALSE);
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Retrieve list of data types for the database
      	 *
      	 * @return array
      	 */
      	public function get_types()
      	{
      		return $this->driver_query('type_list', FALSE);
      	}

      	// -------------------------------------------------------------------------

      	/**
      	 * Method to simplify retrieving db results for meta-data queries
      	 *
      	 * @param string|array|null $query
      	 * @param bool $filtered_index
      	 * @return array
      	 */
      	public function driver_query($query, $filtered_index=TRUE)
      	{
      		// Call the appropriate method, if it exists
      		if (is_string($query) && method_exists($this->sql, $query))
      		{
      			$query = $this->get_sql()->$query();
      		}

      		// Return if the values are returned instead of a query,
      		// or if the query doesn't apply to the driver
      		if ( ! is_string($query)) return $query;

      		// Run the query!
      		$res = $this->query($query);

      		$flag = ($filtered_index) ? \PDO::FETCH_NUM : \PDO::FETCH_ASSOC;
      		$all = $res->fetchAll($flag);

      		return ($filtered_index) ? \db_filter($all, 0) : $all;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Return the number of rows returned for a SELECT query
      	 *
      	 * @see http://us3.php.net/manual/en/pdostatement.rowcount.php#87110
      	 * @return int
      	 */
      	public function num_rows()
      	{
      		$regex = '/^SELECT\s+(?:ALL\s+|DISTINCT\s+)?(?:.*?)\s+FROM\s+(.*)$/i';
      		$output = array();

      		if (preg_match($regex, $this->last_query, $output) > 0)
      		{
      			$stmt = $this->query("SELECT COUNT(*) FROM {$output[1]}");
      			return (int) $stmt->fetchColumn();
      		}

      		return NULL;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Create sql for batch insert
      	 *
      	 * @param string $table
      	 * @param array $data
      	 * @return null|array<string|array|null>
      	 */
      	public function insert_batch($table, $data=array())
      	{
      		$first_row = current($data);
      		if ( ! is_array($first_row)) return NULL;

      		// Values for insertion
      		$vals = array();
      		foreach($data as $group)
      		{
      			$vals = array_merge($vals, array_values($group));
      		}
      		$table = $this->quote_table($table);
      		$fields = array_keys($first_row);

      		$sql = "INSERT INTO {$table} ("
      			. implode(',', $this->quote_ident($fields))
      			. ") VALUES ";

      		// Create the placeholder groups
      		$params = array_fill(0, count($fields), '?');
      		$param_string = "(" . implode(',', $params) . ")";
      		$param_list = array_fill(0, count($data), $param_string);

      		// Append the placeholder groups to the query
      		$sql .= implode(',', $param_list);

      		return array($sql, $vals);
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Helper method for quote_ident
      	 *
      	 * @param mixed $str
      	 * @return mixed
      	 */
      	public function _quote($str)
      	{
      		// Check that the current value is a string,
      		// and is not already quoted before quoting
      		// that value, otherwise, return the original value
      		return (
      			is_string($str)
      			&& strpos($str, $this->escape_char) !== 0
      			&& strrpos($str, $this->escape_char) !== 0
      		)
      			? "{$this->escape_char}{$str}{$this->escape_char}"
      			: $str;

      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Sets the table prefix on the passed string
      	 *
      	 * @param string $str
      	 * @return string
      	 */
      	protected function _prefix($str)
      	{
      		// Don't prefix an already prefixed table
      		if (strpos($str, $this->table_prefix) !== FALSE)
      		{
      			return $str;
      		}

      		return $this->table_prefix.$str;
      	}

      	// -------------------------------------------------------------------------

      	/**
      	 * Empty the passed table
      	 *
      	 * @param string $table
      	 * @return \PDOStatement
      	 */
      	public function truncate($table)
      	{
      		$sql = ($this->has_truncate)
      			? 'TRUNCATE '
      			: 'DELETE FROM ';

      		$sql .= $this->quote_table($table);

      		$this->statement = $this->query($sql);
      		return $this->statement;
      	}

      }
      // End of db_pdo.php
      Generated using phpDox 0.8.2-dev - Copyright (C) 2010 - 2015 by Arne Blankerts
      diff --git a/docs/source/Query/Abstract_Query_Builder.php.html b/docs/source/Query/Abstract_Query_Builder.php.html deleted file mode 100644 index 974b09a..0000000 --- a/docs/source/Query/Abstract_Query_Builder.php.html +++ /dev/null @@ -1,3 +0,0 @@ - -phpDox - Source of Abstract_Query_Builder.php

      Source of file Abstract_Query_Builder.php

      - Size: 13,387 Bytes - Last Modified: 2015-11-10T08:37:58-05:00

      ../src/Query/Abstract_Query_Builder.php

      123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622
      <?php
      /**
       * Query
       *
       * Free Query Builder / Database Abstraction Layer
       *
       * @package		Query
       * @author		Timothy J. Warren
       * @copyright	Copyright (c) 2012 - 2014
       * @link 		https://github.com/aviat4ion/Query
       * @license		http://philsturgeon.co.uk/code/dbad-license
       */

      // --------------------------------------------------------------------------

      namespace Query;

      // --------------------------------------------------------------------------

      /**
       * Abstract Class for internal implementation methods of the Query Builder
       * @package Query
       */
      abstract class Abstract_Query_Builder {

      	// --------------------------------------------------------------------------
      	// ! Constants
      	// --------------------------------------------------------------------------

      	const KEY 	= 0;
      	const VALUE = 1;
      	const BOTH 	= 2;


      	// --------------------------------------------------------------------------
      	// ! 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 string
      	 */
      	protected $limit;

      	/**
      	 * Value for offset in limit string
      	 * @var 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
      	 * @var Driver_Interface
      	 */
      	public $db;

      	/**
      	 * Query parser class instance
      	 * @var Query_Parser
      	 */
      	protected $parser;

      	/**
      	 * Alias to driver util class
      	 * @var \Query\Driver\Abstract_Util
      	 */
      	protected $util;

      	/**
      	 * Alias to driver sql class
      	 * @var \Query\Driver\SQL_Interface
      	 */
      	protected $sql;

      	// --------------------------------------------------------------------------
      	// Methods
      	// --------------------------------------------------------------------------

      	/**
      	 * Set values in the class, with either an array or key value pair
      	 *
      	 * @param array $var
      	 * @param mixed $key
      	 * @param mixed $val
      	 * @param int $val_type
      	 * @return array
      	 */
      	protected function _mixed_set(&$var, $key, $val=NULL, $val_type=self::BOTH)
      	{
      		$arg = (is_scalar($key) && is_scalar($val))
      			? array($key => $val)
      			: $key;

      		foreach($arg as $k => $v)
      		{
      			if (in_array($val_type, array(self::KEY, self::VALUE)))
      			{
      				$var[] = ($val_type === self::KEY)
      					? $k
      					: $v;
      			}
      			else
      			{
      				$var[$k] = $v;
      			}
      		}

      		return $var;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Method to simplify select_ methods
      	 *
      	 * @param string $field
      	 * @param string|bool $as
      	 * @return string
      	 */
      	protected function _select($field, $as = FALSE)
      	{
      		// Escape the identifiers
      		$field = $this->db->quote_ident($field);

      		if ( ! is_string($as)) return $field;


      		$as = $this->db->quote_ident($as);
      		return "({$field}) AS {$as} ";
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Helper function for returning sql strings
      	 *
      	 * @param string $type
      	 * @param string $table
      	 * @param bool $reset
      	 * @return string
      	 */
      	protected function _get_compile($type, $table, $reset)
      	{
      		$sql = $this->_compile($type, $table);

      		// Reset the query builder for the next query
      		if ($reset) $this->reset_query();

      		return $sql;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Simplify 'like' methods
      	 *
      	 * @param string $field
      	 * @param mixed $val
      	 * @param string $pos
      	 * @param string $like
      	 * @param string $conj
      	 * @return Query_Builder
      	 */
      	protected function _like($field, $val, $pos, $like='LIKE', $conj='AND')
      	{
      		$field = $this->db->quote_ident($field);

      		// Add the like string into the order map
      		$like = $field. " {$like} ?";

      		if ($pos == 'before')
      		{
      			$val = "%{$val}";
      		}
      		elseif ($pos == 'after')
      		{
      			$val = "{$val}%";
      		}
      		else
      		{
      			$val = "%{$val}%";
      		}

      		$conj = (empty($this->query_map)) ? ' WHERE ' : " {$conj} ";
      		$this->_append_map($conj, $like, 'like');

      		// Add to the values array
      		$this->where_values[] = $val;

      		return $this;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Simplify building having clauses
      	 *
      	 * @param mixed $key
      	 * @param mixed $val
      	 * @param string $conj
      	 * @return Query_Builder
      	 */
      	protected function _having($key, $val=array(), $conj='AND')
      	{
      		$where = $this->_where($key, $val);

      		// Create key/value placeholders
      		foreach($where as $f => $val)
      		{
      			// Split each key by spaces, in case there
      			// is an operator such as >, <, !=, etc.
      			$f_array = explode(' ', trim($f));

      			$item = $this->db->quote_ident($f_array[0]);

      			// Simple key value, or an operator
      			$item .= (count($f_array) === 1) ? '=?' : " {$f_array[1]} ?";

      			// Put in the having map
      			$this->having_map[] = array(
      				'conjunction' => ( ! empty($this->having_map)) ? " {$conj} " : ' HAVING ',
      				'string' => $item
      			);
      		}

      		return $this;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Do all the repeditive stuff for where/having type methods
      	 *
      	 * @param mixed $key
      	 * @param mixed $val
      	 * @return array
      	 */
      	protected function _where($key, $val=array())
      	{
      		$where = array();
      		$this->_mixed_set($where, $key, $val, self::BOTH);
      		$this->_mixed_set($this->where_values, $key, $val, self::VALUE);
      		return $where;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Simplify generating where string
      	 *
      	 * @param mixed $key
      	 * @param mixed $val
      	 * @param string $defaultConj
      	 * @return Query_Builder
      	 */
      	protected function _where_string($key, $val=array(), $defaultConj='AND')
      	{
      		// Create key/value placeholders
      		foreach($this->_where($key, $val) as $f => $val)
      		{
      			// Split each key by spaces, in case there
      			// is an operator such as >, <, !=, etc.
      			$f_array = explode(' ', trim($f));

      			$item = $this->db->quote_ident($f_array[0]);

      			// Simple key value, or an operator
      			$item .= (count($f_array) === 1) ? '=?' : " {$f_array[1]} ?";
      			$last_item = end($this->query_map);

      			// Determine the correct conjunction
      			$conjunctionList = array_pluck($this->query_map, 'conjunction');
      			if (empty($this->query_map) || ( ! regex_in_array($conjunctionList, "/^ ?\n?WHERE/i")))
      			{
      				$conj = "\nWHERE ";
      			}
      			elseif ($last_item['type'] === 'group_start')
      			{
      				$conj = '';
      			}
      			else
      			{
      				$conj = " {$defaultConj} ";
      			}

      			$this->_append_map($conj, $item, 'where');
      		}

      		return $this;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Simplify where_in methods
      	 *
      	 * @param mixed $key
      	 * @param mixed $val
      	 * @param string $in - The (not) in fragment
      	 * @param string $conj - The where in conjunction
      	 * @return Query_Builder
      	 */
      	protected function _where_in($key, $val=array(), $in='IN', $conj='AND')
      	{
      		$key = $this->db->quote_ident($key);
      		$params = array_fill(0, count($val), '?');

      		foreach($val as $v)
      		{
      			$this->where_values[] = $v;
      		}

      		$conjunction = ( ! empty($this->query_map)) ? " {$conj} " : ' WHERE ';
      		$str = $key . " {$in} (".implode(',', $params).') ';

      		$this->_append_map($conjunction, $str, 'where_in');

      		return $this;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Executes the compiled query
      	 *
      	 * @param string $type
      	 * @param string $table
      	 * @param string $sql
      	 * @param array|null $vals
      	 * @return \PDOStatement
      	 */
      	protected function _run($type, $table, $sql=NULL, $vals=NULL)
      	{
      		if (is_null($sql))
      		{
      			$sql = $this->_compile($type, $table);
      		}

      		if (is_null($vals))
      		{
      			$vals = array_merge($this->values, (array) $this->where_values);
      		}

      		$start_time = microtime(TRUE);

      		$res = (empty($vals))
      			? $this->db->query($sql)
      			: $this->db->prepare_execute($sql, $vals);

      		$end_time = microtime(TRUE);
      		$total_time = number_format($end_time - $start_time, 5);

      		// Add this query to the list of executed queries
      		$this->_append_query($vals, $sql, $total_time);

      		// Reset class state for next query
      		$this->reset_query();

      		return $res;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Add an additional set of mapping pairs to a internal map
      	 *
      	 * @param string $conjunction
      	 * @param string $string
      	 * @param string $type
      	 * @return void
      	 */
      	protected function _append_map($conjunction = '', $string = '', $type = '')
      	{
      		array_push($this->query_map, array(
      			'type' => $type,
      			'conjunction' => $conjunction,
      			'string' => $string
      		));
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Convert the prepared statement into readable sql
      	 *
      	 * @param array $vals
      	 * @param string $sql
      	 * @param string $total_time
      	 * @return void
      	 */
      	protected function _append_query($vals, $sql, $total_time)
      	{
      		$evals = (is_array($vals)) ? $vals : array();
      		$esql = str_replace('?', "%s", $sql);

      		// Quote string values
      		foreach($evals as &$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
      		// as arguments to sprintf
      		array_unshift($evals, $esql);

      		// Add the interpreted query to the list of executed queries
      		$this->queries[] = array(
      			'time' => $total_time,
      			'sql' => call_user_func_array('sprintf', $evals),
      		);

      		$this->queries['total_time'] += $total_time;

      		// Set the last query to get rowcounts properly
      		$this->db->set_last_query($sql);
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Sub-method for generating sql strings
      	 *
      	 * @param string $type
      	 * @param string $table
      	 * @return string
      	 */
      	protected function _compile_type($type='', $table='')
      	{
      		if ($type === 'insert')
      		{
      			$param_count = count($this->set_array_keys);
      			$params = array_fill(0, $param_count, '?');
      			$sql = "INSERT INTO {$table} ("
      				. implode(',', $this->set_array_keys)
      				. ")\nVALUES (".implode(',', $params).')';
      		}
      		elseif ($type === 'update')
      		{
      			$sql = "UPDATE {$table}\nSET {$this->set_string}";
      		}
      		elseif ($type === 'delete')
      		{
      			$sql = "DELETE FROM {$table}";
      		}
      		else // GET queries
      		{
      			$sql = "SELECT * \nFROM {$this->from_string}";

      			// Set the select string
      			if ( ! empty($this->select_string))
      			{
      				// Replace the star with the selected fields
      				$sql = str_replace('*', $this->select_string, $sql);
      			}
      		}

      		return $sql;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * String together the sql statements for sending to the db
      	 *
      	 * @param string $type
      	 * @param string $table
      	 * @return string
      	 */
      	protected function _compile($type='', $table='')
      	{
      		// Get the base clause for the query
      		$sql = $this->_compile_type($type, $this->db->quote_table($table));

      		$clauses = array(
      			'query_map',
      			'group_string',
      			'order_string',
      			'having_map',
      		);

      		// Set each type of subclause
      		foreach($clauses as $clause)
      		{
      			$param = $this->$clause;
      			if (is_array($param))
      			{
      				foreach($param as $q)
      				{
      					$sql .= $q['conjunction'] . $q['string'];
      				}
      			}
      			else
      			{
      				$sql .= $param;
      			}
      		}

      		// Set the limit via the class variables
      		if (is_numeric($this->limit))
      		{
      			$sql = $this->sql->limit($sql, $this->limit, $this->offset);
      		}

      		// See if the query plan, rather than the
      		// query data should be returned
      		if ($this->explain === TRUE)
      		{
      			$sql = $this->sql->explain($sql);
      		}

      		return $sql;
      	}
      }

      // End of abstract_query_builder.php
      Generated using phpDox 0.8.2-dev - Copyright (C) 2010 - 2015 by Arne Blankerts
      diff --git a/docs/source/Query/Abstract_SQL.php.html b/docs/source/Query/Abstract_SQL.php.html deleted file mode 100644 index cef0463..0000000 --- a/docs/source/Query/Abstract_SQL.php.html +++ /dev/null @@ -1,3 +0,0 @@ - -phpDox - Source of Abstract_SQL.php

      Source of file Abstract_SQL.php

      - Size: 0,849 Bytes - Last Modified: 2015-07-16T15:12:52-04:00

      ../src/Query/Abstract_SQL.php

      1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
      <?php
      /**
       * Query
       *
       * Free Query Builder / Database Abstraction Layer
       *
       * @author		Timothy J. Warren
       * @copyright	Copyright (c) 2012 - 2014
       * @link 		https://github.com/aviat4ion/Query
       * @license		http://philsturgeon.co.uk/code/dbad-license
       * @package		Query
       */

      // --------------------------------------------------------------------------

      namespace Query;

      /**
       * parent for database manipulation subclasses
       *
       * @package Query
       * @subpackage Drivers
       */
      abstract class Abstract_SQL implements SQL_Interface {

      	/**
      	 * Limit clause
      	 *
      	 * @param string $sql
      	 * @param int $limit
      	 * @param int|bool $offset
      	 * @return string
      	 */
      	public function limit($sql, $limit, $offset=FALSE)
      	{
      		$sql .= "\nLIMIT {$limit}";

      		if (is_numeric($offset))
      		{
      			$sql .= " OFFSET {$offset}";
      		}

      		return $sql;
      	}
      }
      // End of abstract_sql.php

      Generated using phpDox 0.8.2-dev - Copyright (C) 2010 - 2015 by Arne Blankerts
      diff --git a/docs/source/Query/Abstract_Util.php.html b/docs/source/Query/Abstract_Util.php.html deleted file mode 100644 index 16ceac2..0000000 --- a/docs/source/Query/Abstract_Util.php.html +++ /dev/null @@ -1,3 +0,0 @@ - -phpDox - Source of Abstract_Util.php

      Source of file Abstract_Util.php

      - Size: 3,322 Bytes - Last Modified: 2015-07-16T15:14:02-04:00

      ../src/Query/Abstract_Util.php

      123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
      <?php
      /**
       * Query
       *
       * Free Query Builder / Database Abstraction Layer
       *
       * @package		Query
       * @author		Timothy J. Warren
       * @copyright	Copyright (c) 2012 - 2014
       * @link 		https://github.com/aviat4ion/Query
       * @license		http://philsturgeon.co.uk/code/dbad-license
       */

      // --------------------------------------------------------------------------

      namespace Query;

      // --------------------------------------------------------------------------

      /**
       * Abstract class defining database / table creation methods
       *
       * @package Query
       * @subpackage Drivers
       * @method string quote_ident(string $sql)
       * @method string quote_table(string $sql)
       */
      abstract class Abstract_Util {

      	/**
      	 * Reference to the current connection object
      	 */
      	private $conn;

      	/**
      	 * Save a reference to the connection object for later use
      	 *
      	 * @param Driver_Interface $conn
      	 */
      	public function __construct(Driver_Interface $conn)
      	{
      		$this->conn = $conn;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Get the driver object for the current connection
      	 *
      	 * @return Driver_Interface
      	 */
      	public function get_driver()
      	{
      		return $this->conn;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Convenience public function to generate sql for creating a db table
      	 *
      	 * @param string $name
      	 * @param array $fields
      	 * @param array $constraints
      	 * @param bool $if_not_exists
      	 * @return string
      	 */
      	public function create_table($name, $fields, array $constraints=array(), $if_not_exists=TRUE)
      	{
      		$exists_str = ($if_not_exists) ? ' IF NOT EXISTS ' : ' ';

      		// Reorganize into an array indexed with column information
      		// Eg $column_array[$colname] = array(
      		// 		'type' => ...,
      		// 		'constraint' => ...,
      		// 		'index' => ...,
      		// )
      		$column_array = \array_zipper(array(
      			'type' => $fields,
      			'constraint' => $constraints
      		));

      		// Join column definitions together
      		$columns = array();
      		foreach($column_array as $n => $props)
      		{
      			$str = $this->get_driver()->quote_ident($n);
      			$str .= (isset($props['type'])) ? " {$props['type']}" : "";
      			$str .= (isset($props['constraint'])) ? " {$props['constraint']}" : "";

      			$columns[] = $str;
      		}

      		// Generate the sql for the creation of the table
      		$sql = 'CREATE TABLE'.$exists_str.$this->get_driver()->quote_table($name).' (';
      		$sql .= implode(', ', $columns);
      		$sql .= ')';

      		return $sql;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Drop the selected table
      	 *
      	 * @param string $name
      	 * @return string
      	 */
      	public function delete_table($name)
      	{
      		return 'DROP TABLE IF EXISTS '.$this->get_driver()->quote_table($name);
      	}


      	// --------------------------------------------------------------------------
      	// ! Abstract Methods
      	// --------------------------------------------------------------------------

      	/**
      	 * Return an SQL file with the database table structure
      	 *
      	 * @abstract
      	 * @return string
      	 */
      	abstract public function backup_structure();

      	// --------------------------------------------------------------------------

      	/**
      	 * Return an SQL file with the database data as insert statements
      	 *
      	 * @abstract
      	 * @return string
      	 */
      	abstract public function backup_data();

      }
      // End of abstract_util.php
      Generated using phpDox 0.8.2-dev - Copyright (C) 2010 - 2015 by Arne Blankerts
      diff --git a/docs/source/Query/ConnectionManager.php.html b/docs/source/Query/ConnectionManager.php.html new file mode 100644 index 0000000..8ecab70 --- /dev/null +++ b/docs/source/Query/ConnectionManager.php.html @@ -0,0 +1,3 @@ + +phpDox - Source of ConnectionManager.php

      Source of file ConnectionManager.php

      + Size: 5,787 Bytes - Last Modified: 2015-11-10T10:01:22-05:00

      ../src/Query/ConnectionManager.php

      123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252
      <?php
      /**
       * Query
       *
       * Free Query Builder / Database Abstraction Layer
       *
       * @package		Query
       * @author		Timothy J. Warren
       * @copyright	Copyright (c) 2012 - 2014
       * @link 		https://github.com/aviat4ion/Query
       * @license		http://philsturgeon.co.uk/code/dbad-license
       */

      // --------------------------------------------------------------------------

      namespace Query;

      /**
       * Connection manager class to manage connections for the
       * Query method
       *
       * @package Query
       * @subpackage Core
       */
      final class ConnectionManager {

      	/**
      	 * Map of named database connections
      	 * @var array
      	 */
      	private $connections = array();

      	/**
      	 * Class instance variable
      	 * @var Connection_Manager
      	 */
      	private static $instance = null;

      	// --------------------------------------------------------------------------

      	/**
      	 * Private constructor to prevent multiple instances
      	 * @codeCoverageIgnore
      	 */
      	private function __construct() {}

      	// --------------------------------------------------------------------------

      	/**
      	 * Private clone method to prevent cloning
      	 * @throws \DomainException
      	 */
      	public function __clone()
      	{
      		throw new \DomainException("Can't clone singleton");
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Prevent serialization of this object
      	 * @throws \DomainException
      	 */
      	public function __sleep()
      	{
      		throw new \DomainException("No serializing of singleton");
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Make sure serialize/deserialize doesn't work
      	 * @throws \DomainException
      	 */
      	public function __wakeup()
      	{
      		throw new \DomainException("Can't unserialize singleton");
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Return  a connection manager instance
      	 *
      	 * @staticvar null $instance
      	 * @return Connection_Manager
      	 */
      	public static function get_instance()
      	{
      		if (self::$instance === null) self::$instance = new self();

      		return self::$instance;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Returns the connection specified by the name given
      	 *
      	 * @param string|array|object $name
      	 * @return Query_Builder
      	 * @throws \InvalidArgumentException
      	 */
      	public function get_connection($name = '')
      	{
      		// If the parameter is a string, use it as an array index
      		if (is_scalar($name) && isset($this->connections[$name]))
      		{
      			return $this->connections[$name];
      		}
      		elseif (empty($name) && ! empty($this->connections)) // Otherwise, return the last one
      		{
      			return end($this->connections);
      		}

      		// You should actually connect before trying to get a connection...
      		throw new \InvalidArgumentException("The specified connection does not exist");
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Parse the passed parameters and return a connection
      	 *
      	 * @param \stdClass $params
      	 * @return Query_Builder
      	 */
      	public function connect(\stdClass $params)
      	{
      		list($dsn, $dbtype, $params, $options) = $this->parse_params($params);

      		$dbtype = ucfirst($dbtype);
      		$driver = "\\Query\\Drivers\\{$dbtype}\\Driver";

      		// Create the database connection
      		$db = ( ! empty($params->user))
      			? new $driver($dsn, $params->user, $params->pass, $options)
      			: new $driver($dsn, '', '', $options);

      		// Set the table prefix, if it exists
      		if (isset($params->prefix))
      		{
      			$db->set_table_prefix($params->prefix);
      		}

      		// Create Query Builder object
      		$conn = new QueryBuilder($db, new QueryParser($db));


      		// Save it for later
      		if (isset($params->alias))
      		{
      			$this->connections[$params->alias] = $conn;
      		}
      		else
      		{
      			$this->connections[] = $conn;
      		}

      		return $conn;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Parses params into a dsn and option array
      	 *
      	 * @param \stdClass $params
      	 * @return array
      	 * @throws BadDBDriverException
      	 */
      	public function parse_params(\stdClass $params)
      	{
      		$params->type = strtolower($params->type);
      		$dbtype = ($params->type !== 'postgresql') ? $params->type : 'pgsql';
      		$dbtype = ucfirst($dbtype);

      		// Make sure the class exists
      		if ( ! class_exists("\\Query\\Drivers\\{$dbtype}\\Driver"))
      		{
      			throw new BadDBDriverException('Database driver does not exist, or is not supported');
      		}

      		// Set additional PDO options
      		$options = array();

      		if (isset($params->options))
      		{
      			$options = (array) $params->options;
      		}

      		// Create the dsn for the database to connect to
      		if (strtolower($dbtype) === 'firebird')
      		{
      			$dsn = "{$params->host}:{$params->file}";
      		}
      		else if(strtolower($dbtype) === 'sqlite')
      		{
      			$dsn = $params->file;
      		}
      		else
      		{
      			$dsn = $this->create_dsn($dbtype, $params);
      		}


      		return array($dsn, $dbtype, $params, $options);
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Create the dsn from the db type and params
      	 *
      	 * @param string $dbtype
      	 * @param \stdClass $params
      	 * @return string
      	 */
      	private function create_dsn($dbtype, \stdClass $params)
      	{
      		if (strtolower($dbtype) === 'pdo_firebird') $dbtype = 'firebird';

      		$pairs = array();

      		if ( ! empty($params->database))
      		{
      			$pairs[] = implode('=', array('dbname', $params->database));
      		}

      		$skip = array(
      			'name' => 'name',
      			'pass' => 'pass',
      			'user' => 'user',
      			'type' => 'type',
      			'prefix' => 'prefix',
      			'options' => 'options',
      			'database' => 'database',
      			'alias' => 'alias'
      		);

      		foreach($params as $key => $val)
      		{
      			if (( ! array_key_exists($key, $skip)) && ( ! empty($val)))
      			{
      				$pairs[] = implode('=', array($key, $val));
      			}
      		}

      		return strtolower($dbtype) . ':' . implode(';', $pairs);
      	}
      }
      // End of connection_manager.php
      Generated using phpDox 0.8.2-dev - Copyright (C) 2010 - 2015 by Arne Blankerts
      diff --git a/docs/source/Query/Connection_Manager.php.html b/docs/source/Query/Connection_Manager.php.html deleted file mode 100644 index a526377..0000000 --- a/docs/source/Query/Connection_Manager.php.html +++ /dev/null @@ -1,3 +0,0 @@ - -phpDox - Source of Connection_Manager.php

      Source of file Connection_Manager.php

      - Size: 5,790 Bytes - Last Modified: 2015-07-30T15:30:27-04:00

      ../src/Query/Connection_Manager.php

      123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252
      <?php
      /**
       * Query
       *
       * Free Query Builder / Database Abstraction Layer
       *
       * @package		Query
       * @author		Timothy J. Warren
       * @copyright	Copyright (c) 2012 - 2014
       * @link 		https://github.com/aviat4ion/Query
       * @license		http://philsturgeon.co.uk/code/dbad-license
       */

      // --------------------------------------------------------------------------

      namespace Query;

      /**
       * Connection manager class to manage connections for the
       * Query method
       *
       * @package Query
       * @subpackage Core
       */
      final class Connection_Manager {

      	/**
      	 * Map of named database connections
      	 * @var array
      	 */
      	private $connections = array();

      	/**
      	 * Class instance variable
      	 * @var Connection_Manager
      	 */
      	private static $instance = null;

      	// --------------------------------------------------------------------------

      	/**
      	 * Private constructor to prevent multiple instances
      	 * @codeCoverageIgnore
      	 */
      	private function __construct() {}

      	// --------------------------------------------------------------------------

      	/**
      	 * Private clone method to prevent cloning
      	 * @throws \DomainException
      	 */
      	public function __clone()
      	{
      		throw new \DomainException("Can't clone singleton");
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Prevent serialization of this object
      	 * @throws \DomainException
      	 */
      	public function __sleep()
      	{
      		throw new \DomainException("No serializing of singleton");
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Make sure serialize/deserialize doesn't work
      	 * @throws \DomainException
      	 */
      	public function __wakeup()
      	{
      		throw new \DomainException("Can't unserialize singleton");
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Return  a connection manager instance
      	 *
      	 * @staticvar null $instance
      	 * @return Connection_Manager
      	 */
      	public static function get_instance()
      	{
      		if (self::$instance === null) self::$instance = new self();

      		return self::$instance;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Returns the connection specified by the name given
      	 *
      	 * @param string|array|object $name
      	 * @return Query_Builder
      	 * @throws \InvalidArgumentException
      	 */
      	public function get_connection($name = '')
      	{
      		// If the parameter is a string, use it as an array index
      		if (is_scalar($name) && isset($this->connections[$name]))
      		{
      			return $this->connections[$name];
      		}
      		elseif (empty($name) && ! empty($this->connections)) // Otherwise, return the last one
      		{
      			return end($this->connections);
      		}

      		// You should actually connect before trying to get a connection...
      		throw new \InvalidArgumentException("The specified connection does not exist");
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Parse the passed parameters and return a connection
      	 *
      	 * @param \stdClass $params
      	 * @return Query_Builder
      	 */
      	public function connect(\stdClass $params)
      	{
      		list($dsn, $dbtype, $params, $options) = $this->parse_params($params);

      		$dbtype = ucfirst($dbtype);
      		$driver = "\\Query\\Drivers\\{$dbtype}\\Driver";

      		// Create the database connection
      		$db = ( ! empty($params->user))
      			? new $driver($dsn, $params->user, $params->pass, $options)
      			: new $driver($dsn, '', '', $options);

      		// Set the table prefix, if it exists
      		if (isset($params->prefix))
      		{
      			$db->set_table_prefix($params->prefix);
      		}

      		// Create Query Builder object
      		$conn = new Query_Builder($db, new Query_Parser($db));


      		// Save it for later
      		if (isset($params->alias))
      		{
      			$this->connections[$params->alias] = $conn;
      		}
      		else
      		{
      			$this->connections[] = $conn;
      		}

      		return $conn;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Parses params into a dsn and option array
      	 *
      	 * @param \stdClass $params
      	 * @return array
      	 * @throws BadDBDriverException
      	 */
      	public function parse_params(\stdClass $params)
      	{
      		$params->type = strtolower($params->type);
      		$dbtype = ($params->type !== 'postgresql') ? $params->type : 'pgsql';
      		$dbtype = ucfirst($dbtype);

      		// Make sure the class exists
      		if ( ! class_exists("\\Query\\Drivers\\{$dbtype}\\Driver"))
      		{
      			throw new BadDBDriverException('Database driver does not exist, or is not supported');
      		}

      		// Set additional PDO options
      		$options = array();

      		if (isset($params->options))
      		{
      			$options = (array) $params->options;
      		}

      		// Create the dsn for the database to connect to
      		if (strtolower($dbtype) === 'firebird')
      		{
      			$dsn = "{$params->host}:{$params->file}";
      		}
      		else if(strtolower($dbtype) === 'sqlite')
      		{
      			$dsn = $params->file;
      		}
      		else
      		{
      			$dsn = $this->create_dsn($dbtype, $params);
      		}


      		return array($dsn, $dbtype, $params, $options);
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Create the dsn from the db type and params
      	 *
      	 * @param string $dbtype
      	 * @param \stdClass $params
      	 * @return string
      	 */
      	private function create_dsn($dbtype, \stdClass $params)
      	{
      		if (strtolower($dbtype) === 'pdo_firebird') $dbtype = 'firebird';

      		$pairs = array();

      		if ( ! empty($params->database))
      		{
      			$pairs[] = implode('=', array('dbname', $params->database));
      		}

      		$skip = array(
      			'name' => 'name',
      			'pass' => 'pass',
      			'user' => 'user',
      			'type' => 'type',
      			'prefix' => 'prefix',
      			'options' => 'options',
      			'database' => 'database',
      			'alias' => 'alias'
      		);

      		foreach($params as $key => $val)
      		{
      			if (( ! array_key_exists($key, $skip)) && ( ! empty($val)))
      			{
      				$pairs[] = implode('=', array($key, $val));
      			}
      		}

      		return strtolower($dbtype) . ':' . implode(';', $pairs);
      	}
      }
      // End of connection_manager.php
      Generated using phpDox 0.8.2-dev - Copyright (C) 2010 - 2015 by Arne Blankerts
      diff --git a/docs/source/Query/DriverInterface.php.html b/docs/source/Query/DriverInterface.php.html new file mode 100644 index 0000000..d69e3b5 --- /dev/null +++ b/docs/source/Query/DriverInterface.php.html @@ -0,0 +1,3 @@ + +phpDox - Source of DriverInterface.php

      Source of file DriverInterface.php

      + Size: 5,182 Bytes - Last Modified: 2015-11-10T10:04:17-05:00

      ../src/Query/DriverInterface.php

      123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274
      <?php
      /**
       * Query
       *
       * Free Query Builder / Database Abstraction Layer
       *
       * @package		Query
       * @author		Timothy J. Warren
       * @copyright	Copyright (c) 2012 - 2014
       * @link 		https://github.com/aviat4ion/Query
       * @license		http://philsturgeon.co.uk/code/dbad-license
       */

      // --------------------------------------------------------------------------

      namespace Query;

      /**
       * PDO Interface to implement for database drivers
       *
       * @package Query
       * @subpackage Drivers
       */
      interface DriverInterface {

      	/**
      	 * Constructor/Connection method
      	 *
      	 * @param string $dsn
      	 * @param string $username
      	 * @param string $password
      	 * @param array $driver_options
      	 */
      	public function __construct($dsn, $username=NULL, $password=NULL, array $driver_options = array());

      	/**
      	 * Simplifies prepared statements for database queries
      	 *
      	 * @param string $sql
      	 * @param array $data
      	 * @return \PDOStatement | FALSE
      	 * @throws \InvalidArgumentException
      	 */
      	public function prepare_query($sql, $data);

      	/**
      	 * Begin a transaction
      	 *
      	 * @return bool
      	 */
      	public function beginTransaction();

      	/**
      	 * Commit a transaction
      	 *
      	 * @return bool
      	 */
      	public function commit();

      	/**
      	 * Return the current error code
      	 *
      	 * @return mixed
      	 */
      	public function errorCode();

      	/**
      	 * Return information about the current error
      	 *
      	 * @return array
      	 */
      	public function errorInfo();

      	/**
      	 * Execute an SQL statement and return the number of affected rows
      	 *
      	 * @param string $statement
      	 * @return int
      	 */
      	public function exec($statement);

      	/**
      	 *  Get a connection attribute for the current db driver
      	 *
      	 * @param int $attribute
      	 * @return mixed
      	 */
      	public function getAttribute($attribute);

      	/**
      	 * Rollback a transaction
      	 *
      	 * @return bool
      	 */
      	public function rollback();

      	/**
      	 * Set a connection attribute
      	 * @param int $attribute
      	 * @param mixed $value
      	 * @return bool
      	 */
      	public function setAttribute($attribute, $value);

      	/**
      	 * Retrieve column information for the current database table
      	 *
      	 * @param string $table
      	 * @return array
      	 */
      	public function get_columns($table);

      	/**
      	 * Retrieve list of data types for the database
      	 *
      	 * @return array
      	 */
      	public function get_types();

      	/**
      	 * Retrieve indexes for the table
      	 *
      	 * @param string $table
      	 * @return array
      	 */
      	public function get_indexes($table);

      	/**
      	 * Retrieve foreign keys for the table
      	 *
      	 * @param string $table
      	 * @return array
      	 */
      	public function get_fks($table);

      	/**
      	 * Return list of tables for the current database
      	 *
      	 * @return array
      	 */
      	public function get_tables();

      	/**
      	 * Retrieves an array of non-user-created tables for
      	 * the connection/database
      	 *
      	 * @return array
      	 */
      	public function get_system_tables();

      	/**
      	 * Return list of dbs for the current connection, if possible
      	 *
      	 * @return array
      	 */
      	public function get_dbs();

      	/**
      	 * Return list of views for the current database
      	 *
      	 * @return array
      	 */
      	public function get_views();

      	/**
      	 * Return list of sequences for the current database, if they exist
      	 *
      	 * @return array
      	 */
      	public function get_sequences();

      	/**
      	 * Return list of functions for the current database
      	 *
      	 * @return array
      	 */
      	public function get_functions();

      	/**
      	 * Return list of stored procedures for the current database
      	 *
      	 * @return array
      	 */
      	public function get_procedures();

      	/**
      	 * Return list of triggers for the current database
      	 *
      	 * @return array
      	 */
      	public function get_triggers();

      	/**
      	 * Surrounds the string with the databases identifier escape characters
      	 *
      	 * @param string|array $ident
      	 * @return string|array
      	 */
      	public function quote_ident($ident);

      	/**
      	 * Quote database table name, and set prefix
      	 *
      	 * @param string|array $table
      	 * @return string|array
      	 */
      	public function quote_table($table);

      	/**
      	 * Create and execute a prepared statement with the provided parameters
      	 *
      	 * @param string $sql
      	 * @param array $params
      	 * @return \PDOStatement
      	 */
      	public function prepare_execute($sql, $params);

      	/**
      	 * Get the SQL class for the current driver
      	 *
      	 * @return SQL_Interface
      	 */
      	public function get_sql();

      	/**
      	 * Get the Util class for the current driver
      	 *
      	 * @return Abstract_Util
      	 */
      	public function get_util();

      	/**
      	 * Method to simplify retrieving db results for meta-data queries
      	 *
      	 * @param string|array|null $query
      	 * @param bool $filtered_index
      	 * @return array
      	 */
      	public function driver_query($query, $filtered_index=TRUE);

      	/**
      	 * Returns number of rows affected by an INSERT, UPDATE, DELETE type query
      	 *
      	 * @return int
      	 */
      	public function affected_rows();

      	/**
      	 * Return the number of rows returned for a SELECT query
      	 * @see http://us3.php.net/manual/en/pdostatement.rowcount.php#87110
      	 *
      	 * @return int
      	 */
      	public function num_rows();

      	/**
      	 * Prefixes a table if it is not already prefixed
      	 *
      	 * @param string $table
      	 * @return string
      	 */
      	public function prefix_table($table);

      	/**
      	 * Create sql for batch insert
      	 *
      	 * @param string $table
      	 * @param array $data
      	 * @return array
      	 */
      	public function insert_batch($table, $data=array());
      }
      // End of driver_interface.php

      Generated using phpDox 0.8.2-dev - Copyright (C) 2010 - 2015 by Arne Blankerts
      diff --git a/docs/source/Query/Driver_Interface.php.html b/docs/source/Query/Driver_Interface.php.html deleted file mode 100644 index 8a00d3a..0000000 --- a/docs/source/Query/Driver_Interface.php.html +++ /dev/null @@ -1,3 +0,0 @@ - -phpDox - Source of Driver_Interface.php

      Source of file Driver_Interface.php

      - Size: 5,183 Bytes - Last Modified: 2015-07-30T13:19:25-04:00

      ../src/Query/Driver_Interface.php

      123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274
      <?php
      /**
       * Query
       *
       * Free Query Builder / Database Abstraction Layer
       *
       * @package		Query
       * @author		Timothy J. Warren
       * @copyright	Copyright (c) 2012 - 2014
       * @link 		https://github.com/aviat4ion/Query
       * @license		http://philsturgeon.co.uk/code/dbad-license
       */

      // --------------------------------------------------------------------------

      namespace Query;

      /**
       * PDO Interface to implement for database drivers
       *
       * @package Query
       * @subpackage Drivers
       */
      interface Driver_Interface {

      	/**
      	 * Constructor/Connection method
      	 *
      	 * @param string $dsn
      	 * @param string $username
      	 * @param string $password
      	 * @param array $driver_options
      	 */
      	public function __construct($dsn, $username=NULL, $password=NULL, array $driver_options = array());

      	/**
      	 * Simplifies prepared statements for database queries
      	 *
      	 * @param string $sql
      	 * @param array $data
      	 * @return \PDOStatement | FALSE
      	 * @throws \InvalidArgumentException
      	 */
      	public function prepare_query($sql, $data);

      	/**
      	 * Begin a transaction
      	 *
      	 * @return bool
      	 */
      	public function beginTransaction();

      	/**
      	 * Commit a transaction
      	 *
      	 * @return bool
      	 */
      	public function commit();

      	/**
      	 * Return the current error code
      	 *
      	 * @return mixed
      	 */
      	public function errorCode();

      	/**
      	 * Return information about the current error
      	 *
      	 * @return array
      	 */
      	public function errorInfo();

      	/**
      	 * Execute an SQL statement and return the number of affected rows
      	 *
      	 * @param string $statement
      	 * @return int
      	 */
      	public function exec($statement);

      	/**
      	 *  Get a connection attribute for the current db driver
      	 *
      	 * @param int $attribute
      	 * @return mixed
      	 */
      	public function getAttribute($attribute);

      	/**
      	 * Rollback a transaction
      	 *
      	 * @return bool
      	 */
      	public function rollback();

      	/**
      	 * Set a connection attribute
      	 * @param int $attribute
      	 * @param mixed $value
      	 * @return bool
      	 */
      	public function setAttribute($attribute, $value);

      	/**
      	 * Retrieve column information for the current database table
      	 *
      	 * @param string $table
      	 * @return array
      	 */
      	public function get_columns($table);

      	/**
      	 * Retrieve list of data types for the database
      	 *
      	 * @return array
      	 */
      	public function get_types();

      	/**
      	 * Retrieve indexes for the table
      	 *
      	 * @param string $table
      	 * @return array
      	 */
      	public function get_indexes($table);

      	/**
      	 * Retrieve foreign keys for the table
      	 *
      	 * @param string $table
      	 * @return array
      	 */
      	public function get_fks($table);

      	/**
      	 * Return list of tables for the current database
      	 *
      	 * @return array
      	 */
      	public function get_tables();

      	/**
      	 * Retrieves an array of non-user-created tables for
      	 * the connection/database
      	 *
      	 * @return array
      	 */
      	public function get_system_tables();

      	/**
      	 * Return list of dbs for the current connection, if possible
      	 *
      	 * @return array
      	 */
      	public function get_dbs();

      	/**
      	 * Return list of views for the current database
      	 *
      	 * @return array
      	 */
      	public function get_views();

      	/**
      	 * Return list of sequences for the current database, if they exist
      	 *
      	 * @return array
      	 */
      	public function get_sequences();

      	/**
      	 * Return list of functions for the current database
      	 *
      	 * @return array
      	 */
      	public function get_functions();

      	/**
      	 * Return list of stored procedures for the current database
      	 *
      	 * @return array
      	 */
      	public function get_procedures();

      	/**
      	 * Return list of triggers for the current database
      	 *
      	 * @return array
      	 */
      	public function get_triggers();

      	/**
      	 * Surrounds the string with the databases identifier escape characters
      	 *
      	 * @param string|array $ident
      	 * @return string|array
      	 */
      	public function quote_ident($ident);

      	/**
      	 * Quote database table name, and set prefix
      	 *
      	 * @param string|array $table
      	 * @return string|array
      	 */
      	public function quote_table($table);

      	/**
      	 * Create and execute a prepared statement with the provided parameters
      	 *
      	 * @param string $sql
      	 * @param array $params
      	 * @return \PDOStatement
      	 */
      	public function prepare_execute($sql, $params);

      	/**
      	 * Get the SQL class for the current driver
      	 *
      	 * @return SQL_Interface
      	 */
      	public function get_sql();

      	/**
      	 * Get the Util class for the current driver
      	 *
      	 * @return Abstract_Util
      	 */
      	public function get_util();

      	/**
      	 * Method to simplify retrieving db results for meta-data queries
      	 *
      	 * @param string|array|null $query
      	 * @param bool $filtered_index
      	 * @return array
      	 */
      	public function driver_query($query, $filtered_index=TRUE);

      	/**
      	 * Returns number of rows affected by an INSERT, UPDATE, DELETE type query
      	 *
      	 * @return int
      	 */
      	public function affected_rows();

      	/**
      	 * Return the number of rows returned for a SELECT query
      	 * @see http://us3.php.net/manual/en/pdostatement.rowcount.php#87110
      	 *
      	 * @return int
      	 */
      	public function num_rows();

      	/**
      	 * Prefixes a table if it is not already prefixed
      	 *
      	 * @param string $table
      	 * @return string
      	 */
      	public function prefix_table($table);

      	/**
      	 * Create sql for batch insert
      	 *
      	 * @param string $table
      	 * @param array $data
      	 * @return array
      	 */
      	public function insert_batch($table, $data=array());
      }
      // End of driver_interface.php

      Generated using phpDox 0.8.2-dev - Copyright (C) 2010 - 2015 by Arne Blankerts
      diff --git a/docs/source/Query/Drivers/Firebird/Driver.php.html b/docs/source/Query/Drivers/Firebird/Driver.php.html index 70e017a..0c62c73 100644 --- a/docs/source/Query/Drivers/Firebird/Driver.php.html +++ b/docs/source/Query/Drivers/Firebird/Driver.php.html @@ -1,3 +1,3 @@ phpDox - Source of Driver.php

      Source of file Driver.php

      - Size: 8,787 Bytes - Last Modified: 2015-07-30T14:06:22-04:00

      ../src/Query/Drivers/Firebird/Driver.php

      123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399
      <?php
      /**
       * Query
       *
       * Free Query Builder / Database Abstraction Layer
       *
       * @package		Query
       * @author		Timothy J. Warren
       * @copyright	Copyright (c) 2012 - 2014
       * @link 		https://github.com/aviat4ion/Query
       * @license		http://philsturgeon.co.uk/code/dbad-license
       */

      // --------------------------------------------------------------------------

      namespace Query\Drivers\Firebird;

      /**
       * Firebird Database class
       *
       * PDO-firebird isn't stable, so this is a wrapper of the fbird_ public functions.
       *
       * @package Query
       * @subpackage Drivers
       */
      class Driver extends \Query\Abstract_Driver {

      	/**
      	 * Reference to the last query executed
      	 *
      	 * @var object
      	 */
      	protected $statement = NULL;

      	/**
      	 * Reference to the resource returned by
      	 * the last query executed
      	 *
      	 * @var resource
      	 */
      	protected $statement_link = NULL;

      	/**
      	 * Reference to the current transaction
      	 *
      	 * @var resource
      	 */
      	protected $trans = NULL;

      	/**
      	 * Reference to the connection resource
      	 *
      	 * @var resource
      	 */
      	protected $conn = NULL;

      	/**
      	 * Reference to the service resource
      	 *
      	 * @var resource
      	 */
      	protected $service = NULL;

      	/**
      	 * Firebird doesn't have the truncate keyword
      	 *
      	 * @var bool
      	 */
      	protected $has_truncate = FALSE;

      	/**
      	 * Open the link to the database
      	 *
      	 * @param string $dbpath
      	 * @param string $user
      	 * @param string $pass
      	 * @param array $options
      	 * @throws \PDOException
      	 */
      	public function __construct($dbpath, $user='SYSDBA', $pass='masterkey', array $options = array())
      	{
      		$connect_function = (isset($options[\PDO::ATTR_PERSISTENT]) && $options[\PDO::ATTR_PERSISTENT] == TRUE)
      			? '\\fbird_pconnect'
      			: '\\fbird_connect';

      		$this->conn = $connect_function($dbpath, $user, $pass, 'utf-8', 0);
      		$this->service = \fbird_service_attach('localhost', $user, $pass);

      		// Throw an exception to make this match other pdo classes
      		if ( ! \is_resource($this->conn)) throw new \PDOException(\fbird_errmsg(), \fbird_errcode(), NULL);

      		// Load these classes here because this
      		// driver does not call the constructor
      		// of DB_PDO, which defines these
      		// class variables for the other drivers
      		$this->_load_sub_classes();
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Cleanup some loose ends
      	 * @codeCoverageIgnore
      	 */
      	public function __destruct()
      	{
      		\fbird_service_detach($this->service);
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Return service handle
      	 *
      	 * @return resource
      	 */
      	public function get_service()
      	{
      		return $this->service;
      	}


      	// --------------------------------------------------------------------------

      	/**
      	 * Execute an sql statement and return number of affected rows
      	 *
      	 * @param string $sql
      	 * @return int
      	 */
      	public function exec($sql)
      	{
      		return NULL;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Implement for compatibility with PDO
      	 *
      	 * @param int $attribute
      	 * @return mixed
      	 */
      	public function getAttribute($attribute)
      	{
      		return NULL;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Return whether the current statement is in a transaction
      	 *
      	 * @return bool
      	 */
      	public function inTransaction()
      	{
      		return ! is_null($this->trans);
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Returns the last value of the specified generator
      	 *
      	 * @param string $name
      	 * @return mixed
      	 */
      	public function lastInsertId($name = NULL)
      	{
      		return \fbird_gen_id($name, 0, $this->conn);
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Wrapper public function to better match PDO
      	 *
      	 * @param string $sql
      	 * @return Result
      	 * @throws PDOException
      	 */
      	public function query($sql = '')
      	{

      		if (empty($sql)) throw new \PDOException("Query method requires an sql query!", 0, NULL);

      		$this->statement_link = (isset($this->trans))
      			? \fbird_query($this->trans, $sql)
      			: \fbird_query($this->conn, $sql);

      		// Throw the error as a exception
      		$err_string = \fbird_errmsg() . "Last query:" . $this->get_last_query();
      		if ($this->statement_link === FALSE) throw new \PDOException($err_string, \fbird_errcode(), NULL);

      		$this->statement = new Result($this->statement_link, $this);

      		return $this->statement;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Emulate PDO prepare
      	 *
      	 * @param string $query
      	 * @param array $options
      	 * @return Result
      	 * @throws \PDOException
      	 */
      	public function prepare($query, $options=array())
      	{
      		$this->statement_link = \fbird_prepare($this->conn, $query);

      		// Throw the error as an exception
      		if ($this->statement_link === FALSE) throw new \PDOException(\fbird_errmsg(), \fbird_errcode(), NULL);

      		$this->statement = new Result($this->statement_link, $this);

      		return $this->statement;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Start a database transaction
      	 *
      	 * @return boolean|null
      	 */
      	public function beginTransaction()
      	{
      		return (($this->trans = \fbird_trans($this->conn)) !== NULL) ? TRUE : NULL;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Commit a database transaction
      	 *
      	 * @return bool
      	 */
      	public function commit()
      	{
      		$res = \fbird_commit($this->trans);
      		$this->trans = NULL;
      		return $res;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Rollback a transaction
      	 *
      	 * @return bool
      	 */
      	public function rollBack()
      	{
      		$res = \fbird_rollback($this->trans);
      		$this->trans = NULL;
      		return $res;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Set a connection attribute
      	 * @param int $attribute
      	 * @param mixed $value
      	 * @return bool
      	 */
      	public function setAttribute($attribute, $value)
      	{
      		return FALSE;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Prepare and execute a query
      	 *
      	 * @param string $sql
      	 * @param array $args
      	 * @return Result
      	 */
      	public function prepare_execute($sql, $args)
      	{
      		$query = $this->prepare($sql);

      		// Set the statement in the class variable for easy later access
      		$this->statement_link =& $query;

      		return $query->execute($args);
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Method to emulate PDO->quote
      	 *
      	 * @param string $str
      	 * @param int $param_type
      	 * @return string
      	 */
      	public function quote($str, $param_type = \PDO::PARAM_STR)
      	{
      		if(is_numeric($str))
      		{
      			return $str;
      		}

      		return "'".str_replace("'", "''", $str)."'";
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Method to emulate PDO->errorInfo / PDOStatement->errorInfo
      	 *
      	 * @return array
      	 */
      	public function errorInfo()
      	{
      		$code = \fbird_errcode();
      		$msg = \fbird_errmsg();

      		return array(0, $code, $msg);
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Method to emulate PDO->errorCode
      	 *
      	 * @return array
      	 */
      	public function errorCode()
      	{
      		return \fbird_errcode();
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Bind a prepared query with arguments for executing
      	 *
      	 * @param string $sql
      	 * @param array $params
      	 * @return NULL
      	 */
      	public function prepare_query($sql, $params)
      	{
      		// You can't bind query statements before execution with
      		// the firebird database
      		return NULL;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Create sql for batch insert
      	 *
      	 * @param string $table
      	 * @param array $data
      	 * @return array
      	 */
      	public function insert_batch($table, $data=array())
      	{
      		// Each member of the data array needs to be an array
      		if ( ! is_array(current($data))) return NULL;

      		// Start the block of sql statements
      		$sql = "EXECUTE BLOCK AS BEGIN\n";

      		$table = $this->quote_table($table);
      		$fields = \array_keys(\current($data));

      		$insert_template = "INSERT INTO {$table} ("
      			. implode(',', $this->quote_ident($fields))
      			. ") VALUES (";

      		foreach($data as $item)
      		{
      			// Quote string values
      			$vals = array_map(array($this, 'quote'), $item);

      			// Add the values in the sql
      			$sql .= $insert_template . implode(', ', $vals) . ");\n";
      		}

      		// End the block of SQL statements
      		$sql .= "END";

      		// 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);
      	}
      }
      // End of firebird_driver.php
      Generated using phpDox 0.8.2-dev - Copyright (C) 2010 - 2015 by Arne Blankerts
      + Size: 8,786 Bytes - Last Modified: 2015-11-10T09:58:30-05:00

      ../src/Query/Drivers/Firebird/Driver.php

      123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399
      <?php
      /**
       * Query
       *
       * Free Query Builder / Database Abstraction Layer
       *
       * @package		Query
       * @author		Timothy J. Warren
       * @copyright	Copyright (c) 2012 - 2014
       * @link 		https://github.com/aviat4ion/Query
       * @license		http://philsturgeon.co.uk/code/dbad-license
       */

      // --------------------------------------------------------------------------

      namespace Query\Drivers\Firebird;

      /**
       * Firebird Database class
       *
       * PDO-firebird isn't stable, so this is a wrapper of the fbird_ public functions.
       *
       * @package Query
       * @subpackage Drivers
       */
      class Driver extends \Query\AbstractDriver {

      	/**
      	 * Reference to the last query executed
      	 *
      	 * @var object
      	 */
      	protected $statement = NULL;

      	/**
      	 * Reference to the resource returned by
      	 * the last query executed
      	 *
      	 * @var resource
      	 */
      	protected $statement_link = NULL;

      	/**
      	 * Reference to the current transaction
      	 *
      	 * @var resource
      	 */
      	protected $trans = NULL;

      	/**
      	 * Reference to the connection resource
      	 *
      	 * @var resource
      	 */
      	protected $conn = NULL;

      	/**
      	 * Reference to the service resource
      	 *
      	 * @var resource
      	 */
      	protected $service = NULL;

      	/**
      	 * Firebird doesn't have the truncate keyword
      	 *
      	 * @var bool
      	 */
      	protected $has_truncate = FALSE;

      	/**
      	 * Open the link to the database
      	 *
      	 * @param string $dbpath
      	 * @param string $user
      	 * @param string $pass
      	 * @param array $options
      	 * @throws \PDOException
      	 */
      	public function __construct($dbpath, $user='SYSDBA', $pass='masterkey', array $options = array())
      	{
      		$connect_function = (isset($options[\PDO::ATTR_PERSISTENT]) && $options[\PDO::ATTR_PERSISTENT] == TRUE)
      			? '\\fbird_pconnect'
      			: '\\fbird_connect';

      		$this->conn = $connect_function($dbpath, $user, $pass, 'utf-8', 0);
      		$this->service = \fbird_service_attach('localhost', $user, $pass);

      		// Throw an exception to make this match other pdo classes
      		if ( ! \is_resource($this->conn)) throw new \PDOException(\fbird_errmsg(), \fbird_errcode(), NULL);

      		// Load these classes here because this
      		// driver does not call the constructor
      		// of DB_PDO, which defines these
      		// class variables for the other drivers
      		$this->_load_sub_classes();
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Cleanup some loose ends
      	 * @codeCoverageIgnore
      	 */
      	public function __destruct()
      	{
      		\fbird_service_detach($this->service);
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Return service handle
      	 *
      	 * @return resource
      	 */
      	public function get_service()
      	{
      		return $this->service;
      	}


      	// --------------------------------------------------------------------------

      	/**
      	 * Execute an sql statement and return number of affected rows
      	 *
      	 * @param string $sql
      	 * @return int
      	 */
      	public function exec($sql)
      	{
      		return NULL;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Implement for compatibility with PDO
      	 *
      	 * @param int $attribute
      	 * @return mixed
      	 */
      	public function getAttribute($attribute)
      	{
      		return NULL;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Return whether the current statement is in a transaction
      	 *
      	 * @return bool
      	 */
      	public function inTransaction()
      	{
      		return ! is_null($this->trans);
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Returns the last value of the specified generator
      	 *
      	 * @param string $name
      	 * @return mixed
      	 */
      	public function lastInsertId($name = NULL)
      	{
      		return \fbird_gen_id($name, 0, $this->conn);
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Wrapper public function to better match PDO
      	 *
      	 * @param string $sql
      	 * @return Result
      	 * @throws PDOException
      	 */
      	public function query($sql = '')
      	{

      		if (empty($sql)) throw new \PDOException("Query method requires an sql query!", 0, NULL);

      		$this->statement_link = (isset($this->trans))
      			? \fbird_query($this->trans, $sql)
      			: \fbird_query($this->conn, $sql);

      		// Throw the error as a exception
      		$err_string = \fbird_errmsg() . "Last query:" . $this->get_last_query();
      		if ($this->statement_link === FALSE) throw new \PDOException($err_string, \fbird_errcode(), NULL);

      		$this->statement = new Result($this->statement_link, $this);

      		return $this->statement;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Emulate PDO prepare
      	 *
      	 * @param string $query
      	 * @param array $options
      	 * @return Result
      	 * @throws \PDOException
      	 */
      	public function prepare($query, $options=array())
      	{
      		$this->statement_link = \fbird_prepare($this->conn, $query);

      		// Throw the error as an exception
      		if ($this->statement_link === FALSE) throw new \PDOException(\fbird_errmsg(), \fbird_errcode(), NULL);

      		$this->statement = new Result($this->statement_link, $this);

      		return $this->statement;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Start a database transaction
      	 *
      	 * @return boolean|null
      	 */
      	public function beginTransaction()
      	{
      		return (($this->trans = \fbird_trans($this->conn)) !== NULL) ? TRUE : NULL;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Commit a database transaction
      	 *
      	 * @return bool
      	 */
      	public function commit()
      	{
      		$res = \fbird_commit($this->trans);
      		$this->trans = NULL;
      		return $res;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Rollback a transaction
      	 *
      	 * @return bool
      	 */
      	public function rollBack()
      	{
      		$res = \fbird_rollback($this->trans);
      		$this->trans = NULL;
      		return $res;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Set a connection attribute
      	 * @param int $attribute
      	 * @param mixed $value
      	 * @return bool
      	 */
      	public function setAttribute($attribute, $value)
      	{
      		return FALSE;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Prepare and execute a query
      	 *
      	 * @param string $sql
      	 * @param array $args
      	 * @return Result
      	 */
      	public function prepare_execute($sql, $args)
      	{
      		$query = $this->prepare($sql);

      		// Set the statement in the class variable for easy later access
      		$this->statement_link =& $query;

      		return $query->execute($args);
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Method to emulate PDO->quote
      	 *
      	 * @param string $str
      	 * @param int $param_type
      	 * @return string
      	 */
      	public function quote($str, $param_type = \PDO::PARAM_STR)
      	{
      		if(is_numeric($str))
      		{
      			return $str;
      		}

      		return "'".str_replace("'", "''", $str)."'";
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Method to emulate PDO->errorInfo / PDOStatement->errorInfo
      	 *
      	 * @return array
      	 */
      	public function errorInfo()
      	{
      		$code = \fbird_errcode();
      		$msg = \fbird_errmsg();

      		return array(0, $code, $msg);
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Method to emulate PDO->errorCode
      	 *
      	 * @return array
      	 */
      	public function errorCode()
      	{
      		return \fbird_errcode();
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Bind a prepared query with arguments for executing
      	 *
      	 * @param string $sql
      	 * @param array $params
      	 * @return NULL
      	 */
      	public function prepare_query($sql, $params)
      	{
      		// You can't bind query statements before execution with
      		// the firebird database
      		return NULL;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Create sql for batch insert
      	 *
      	 * @param string $table
      	 * @param array $data
      	 * @return array
      	 */
      	public function insert_batch($table, $data=array())
      	{
      		// Each member of the data array needs to be an array
      		if ( ! is_array(current($data))) return NULL;

      		// Start the block of sql statements
      		$sql = "EXECUTE BLOCK AS BEGIN\n";

      		$table = $this->quote_table($table);
      		$fields = \array_keys(\current($data));

      		$insert_template = "INSERT INTO {$table} ("
      			. implode(',', $this->quote_ident($fields))
      			. ") VALUES (";

      		foreach($data as $item)
      		{
      			// Quote string values
      			$vals = array_map(array($this, 'quote'), $item);

      			// Add the values in the sql
      			$sql .= $insert_template . implode(', ', $vals) . ");\n";
      		}

      		// End the block of SQL statements
      		$sql .= "END";

      		// 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);
      	}
      }
      // End of firebird_driver.php
      Generated using phpDox 0.8.2-dev - Copyright (C) 2010 - 2015 by Arne Blankerts
      diff --git a/docs/source/Query/Drivers/Firebird/SQL.php.html b/docs/source/Query/Drivers/Firebird/SQL.php.html index e208fa9..4f1e9c7 100644 --- a/docs/source/Query/Drivers/Firebird/SQL.php.html +++ b/docs/source/Query/Drivers/Firebird/SQL.php.html @@ -1,3 +1,3 @@ phpDox - Source of SQL.php

      Source of file SQL.php

      - Size: 7,275 Bytes - Last Modified: 2015-07-16T15:07:14-04:00

      ../src/Query/Drivers/Firebird/SQL.php

      123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319
      <?php
      /**
       * Query
       *
       * Free Query Builder / Database Abstraction Layer
       *
       * @package		Query
       * @author		Timothy J. Warren
       * @copyright	Copyright (c) 2012 - 2014
       * @link 		https://github.com/aviat4ion/Query
       * @license		http://philsturgeon.co.uk/code/dbad-license
       */

      // --------------------------------------------------------------------------

      namespace Query\Drivers\Firebird;

      /**
       * Firebird Specific SQL
       *
       * @package Query
       * @subpackage Drivers
       */
      class SQL extends \Query\Abstract_SQL {

      	/**
      	 * Limit clause
      	 *
      	 * @param string $sql
      	 * @param int $limit
      	 * @param int|bool $offset
      	 * @return string
      	 */
      	public function limit($sql, $limit, $offset=FALSE)
      	{
      		// Keep the current sql string safe for a moment
      		$orig_sql = $sql;

      		$sql = 'FIRST '. (int) $limit;

      		if ($offset > 0)
      		{
      			$sql .= ' SKIP '. (int) $offset;
      		}

      		$sql = preg_replace("`SELECT`i", "SELECT {$sql}", $orig_sql);

      		return $sql;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Get the query plan for the sql query
      	 *
      	 * @param string $sql
      	 * @return string
      	 */
      	public function explain($sql)
      	{
      		return $sql;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Random ordering keyword
      	 *
      	 * @return string
      	 */
      	public function random()
      	{
      		return NULL;
      	}


      	// --------------------------------------------------------------------------

      	/**
      	 * Returns sql to list other databases
      	 *
      	 * @return NULL
      	 */
      	public function db_list()
      	{
      		return NULL;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Returns sql to list tables
      	 *
      	 * @return string
      	 */
      	public function table_list()
      	{
      		return <<<SQL
      			SELECT TRIM("RDB\$RELATION_NAME")
      			FROM "RDB\$RELATIONS"
      			WHERE "RDB\$SYSTEM_FLAG"=0
      			AND "RDB\$VIEW_BLR" IS NULL
      			ORDER BY "RDB\$RELATION_NAME" ASC
      SQL;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Returns sql to list system tables
      	 *
      	 * @return string
      	 */
      	public function system_table_list()
      	{
      		return <<<SQL
      			SELECT TRIM("RDB\$RELATION_NAME")
      			FROM "RDB\$RELATIONS"
      			WHERE "RDB\$SYSTEM_FLAG"=1
      			ORDER BY "RDB\$RELATION_NAME" ASC
      SQL;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Returns sql to list views
      	 *
      	 * @return string
      	 */
      	public function view_list()
      	{
      		return <<<SQL
      			SELECT DISTINCT TRIM("RDB\$VIEW_NAME")
      			FROM "RDB\$VIEW_RELATIONS"
      SQL;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Returns sql to list triggers
      	 *
      	 * @return string
      	 */
      	public function trigger_list()
      	{
      		return <<<SQL
      			SELECT * FROM "RDB\$FUNCTIONS"
      			WHERE "RDB\$SYSTEM_FLAG" = 0
      SQL;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Return sql to list functions
      	 *
      	 * @return string
      	 */
      	public function function_list()
      	{
      		return 'SELECT * FROM "RDB$FUNCTIONS"';
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Return sql to list stored procedures
      	 *
      	 * @return string
      	 */
      	public function procedure_list()
      	{
      		return <<<SQL
      			SELECT "RDB\$PROCEDURE_NAME",
      				"RDB\$PROCEDURE_ID",
      				"RDB\$PROCEDURE_INPUTS",
      				"RDB\$PROCEDURE_OUTPUTS",
      				"RDB\$DESCRIPTION",
      				"RDB\$PROCEDURE_SOURCE",
      				"RDB\$SECURITY_CLASS",
      				"RDB\$OWNER_NAME",
      				"RDB\$RUNTIME",
      				"RDB\$SYSTEM_FLAG",
      				"RDB\$PROCEDURE_TYPE",
      				"RDB\$VALID_BLR"
      			FROM "RDB\$PROCEDURES"
      			ORDER BY "RDB\$PROCEDURE_NAME" ASC
      SQL;

      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Return sql to list sequences
      	 *
      	 * @return string
      	 */
      	public function sequence_list()
      	{
      		return <<<SQL
      			SELECT TRIM("RDB\$GENERATOR_NAME")
      			FROM "RDB\$GENERATORS"
      			WHERE "RDB\$SYSTEM_FLAG" = 0
      SQL;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Return sql to list columns of the specified table
      	 *
      	 * @param string $table
      	 * @return string
      	 */
      	public function column_list($table)
      	{
      		return <<<SQL
      			SELECT r.RDB\$FIELD_NAME AS field_name,
      				r.RDB\$DESCRIPTION AS field_description,
      				r.RDB\$DEFAULT_VALUE AS field_default_value,
      				r.RDB\$NULL_FLAG AS field_not_null_constraint,
      				f.RDB\$FIELD_LENGTH AS field_length,
      				f.RDB\$FIELD_PRECISION AS field_precision,
      				f.RDB\$FIELD_SCALE AS field_scale,
      				CASE f.RDB\$FIELD_TYPE
      					WHEN 261 THEN 'BLOB'
      					WHEN 14 THEN 'CHAR'
      					WHEN 40 THEN 'CSTRING'
      					WHEN 11 THEN 'D_FLOAT'
      					WHEN 27 THEN 'DOUBLE'
      					WHEN 10 THEN 'FLOAT'
      					WHEN 16 THEN 'INT64'
      					WHEN 8 THEN 'INTEGER'
      					WHEN 9 THEN 'QUAD'
      					WHEN 7 THEN 'SMALLINT'
      					WHEN 12 THEN 'DATE'
      					WHEN 13 THEN 'TIME'
      					WHEN 35 THEN 'TIMESTAMP'
      					WHEN 37 THEN 'VARCHAR'
      				ELSE 'UNKNOWN'
      				END AS field_type,
      				f.RDB\$FIELD_SUB_TYPE AS field_subtype,
      				coll.RDB\$COLLATION_NAME AS field_collation,
      				cset.RDB\$CHARACTER_SET_NAME AS field_charset
      			FROM RDB\$RELATION_FIELDS r
      			LEFT JOIN RDB\$FIELDS f ON r.RDB\$FIELD_SOURCE = f.RDB\$FIELD_NAME
      			LEFT JOIN RDB\$COLLATIONS coll ON f.RDB\$COLLATION_ID = coll.RDB\$COLLATION_ID
      			LEFT JOIN RDB\$CHARACTER_SETS cset ON f.RDB\$CHARACTER_SET_ID = cset.RDB\$CHARACTER_SET_ID
      			WHERE r.RDB\$RELATION_NAME='{$table}'
      			ORDER BY r.RDB\$FIELD_POSITION
      SQL;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * SQL to show list of field types
      	 *
      	 * @return string
      	 */
      	public function type_list()
      	{
      		return <<<SQL
      			SELECT "RDB\$TYPE_NAME", "RDB\$FIELD_NAME" FROM "RDB\$TYPES"
      			WHERE "RDB\$FIELD_NAME" IN ('RDB\$FIELD_TYPE', 'RDB\$FIELD_SUB_TYPE')
      			ORDER BY "RDB\$FIELD_NAME" DESC, "RDB\$TYPE_NAME" ASC
      SQL;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Get the list of foreign keys for the current
      	 * table
      	 *
      	 * @param string $table
      	 * @return string
      	 */
      	public function fk_list($table)
      	{
      		return <<<SQL
      		SELECT DISTINCT
      			TRIM(d1.RDB\$FIELD_NAME) AS "child_column",
      			TRIM(d2.RDB\$DEPENDED_ON_NAME) AS "parent_table",
      			TRIM(d2.RDB\$FIELD_NAME) AS "parent_column",
      			TRIM(refc.RDB\$UPDATE_RULE) AS "update",
      			TRIM(refc.RDB\$DELETE_RULE) AS "delete"
      		FROM RDB\$RELATION_CONSTRAINTS AS rc
      		LEFT JOIN RDB\$REF_CONSTRAINTS refc ON rc.RDB\$CONSTRAINT_NAME = refc.RDB\$CONSTRAINT_NAME
      		LEFT JOIN RDB\$DEPENDENCIES d1 ON d1.RDB\$DEPENDED_ON_NAME = rc.RDB\$RELATION_NAME
      		LEFT JOIN RDB\$DEPENDENCIES d2 ON d1.RDB\$DEPENDENT_NAME = d2.RDB\$DEPENDENT_NAME
      		WHERE rc.RDB\$CONSTRAINT_TYPE = 'FOREIGN KEY'
      			AND d1.RDB\$DEPENDED_ON_NAME <> d2.RDB\$DEPENDED_ON_NAME
      			AND d1.RDB\$FIELD_NAME <> d2.RDB\$FIELD_NAME
      			AND rc.RDB\$RELATION_NAME = '{$table}'  -- table name
      SQL;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Get the list of indexes for the current table
      	 *
      	 * @param string $table
      	 * @return array
      	 */
      	public function index_list($table)
      	{
      		return <<<SQL
      			SELECT "RDB\$INDEX_NAME", "RDB\$UNIQUE_FLAG", "RDB\$FOREIGN_KEY"
      			FROM "RDB\$INDICES"
      			WHERE "RDB\$RELATION_NAME"='{$table}'
      SQL;
      	}
      }
      //End of firebird_sql.php
      Generated using phpDox 0.8.2-dev - Copyright (C) 2010 - 2015 by Arne Blankerts
      + Size: 7,274 Bytes - Last Modified: 2015-11-10T10:04:50-05:00

      ../src/Query/Drivers/Firebird/SQL.php

      123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319
      <?php
      /**
       * Query
       *
       * Free Query Builder / Database Abstraction Layer
       *
       * @package		Query
       * @author		Timothy J. Warren
       * @copyright	Copyright (c) 2012 - 2014
       * @link 		https://github.com/aviat4ion/Query
       * @license		http://philsturgeon.co.uk/code/dbad-license
       */

      // --------------------------------------------------------------------------

      namespace Query\Drivers\Firebird;

      /**
       * Firebird Specific SQL
       *
       * @package Query
       * @subpackage Drivers
       */
      class SQL extends \Query\AbstractSQL {

      	/**
      	 * Limit clause
      	 *
      	 * @param string $sql
      	 * @param int $limit
      	 * @param int|bool $offset
      	 * @return string
      	 */
      	public function limit($sql, $limit, $offset=FALSE)
      	{
      		// Keep the current sql string safe for a moment
      		$orig_sql = $sql;

      		$sql = 'FIRST '. (int) $limit;

      		if ($offset > 0)
      		{
      			$sql .= ' SKIP '. (int) $offset;
      		}

      		$sql = preg_replace("`SELECT`i", "SELECT {$sql}", $orig_sql);

      		return $sql;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Get the query plan for the sql query
      	 *
      	 * @param string $sql
      	 * @return string
      	 */
      	public function explain($sql)
      	{
      		return $sql;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Random ordering keyword
      	 *
      	 * @return string
      	 */
      	public function random()
      	{
      		return NULL;
      	}


      	// --------------------------------------------------------------------------

      	/**
      	 * Returns sql to list other databases
      	 *
      	 * @return NULL
      	 */
      	public function db_list()
      	{
      		return NULL;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Returns sql to list tables
      	 *
      	 * @return string
      	 */
      	public function table_list()
      	{
      		return <<<SQL
      			SELECT TRIM("RDB\$RELATION_NAME")
      			FROM "RDB\$RELATIONS"
      			WHERE "RDB\$SYSTEM_FLAG"=0
      			AND "RDB\$VIEW_BLR" IS NULL
      			ORDER BY "RDB\$RELATION_NAME" ASC
      SQL;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Returns sql to list system tables
      	 *
      	 * @return string
      	 */
      	public function system_table_list()
      	{
      		return <<<SQL
      			SELECT TRIM("RDB\$RELATION_NAME")
      			FROM "RDB\$RELATIONS"
      			WHERE "RDB\$SYSTEM_FLAG"=1
      			ORDER BY "RDB\$RELATION_NAME" ASC
      SQL;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Returns sql to list views
      	 *
      	 * @return string
      	 */
      	public function view_list()
      	{
      		return <<<SQL
      			SELECT DISTINCT TRIM("RDB\$VIEW_NAME")
      			FROM "RDB\$VIEW_RELATIONS"
      SQL;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Returns sql to list triggers
      	 *
      	 * @return string
      	 */
      	public function trigger_list()
      	{
      		return <<<SQL
      			SELECT * FROM "RDB\$FUNCTIONS"
      			WHERE "RDB\$SYSTEM_FLAG" = 0
      SQL;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Return sql to list functions
      	 *
      	 * @return string
      	 */
      	public function function_list()
      	{
      		return 'SELECT * FROM "RDB$FUNCTIONS"';
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Return sql to list stored procedures
      	 *
      	 * @return string
      	 */
      	public function procedure_list()
      	{
      		return <<<SQL
      			SELECT "RDB\$PROCEDURE_NAME",
      				"RDB\$PROCEDURE_ID",
      				"RDB\$PROCEDURE_INPUTS",
      				"RDB\$PROCEDURE_OUTPUTS",
      				"RDB\$DESCRIPTION",
      				"RDB\$PROCEDURE_SOURCE",
      				"RDB\$SECURITY_CLASS",
      				"RDB\$OWNER_NAME",
      				"RDB\$RUNTIME",
      				"RDB\$SYSTEM_FLAG",
      				"RDB\$PROCEDURE_TYPE",
      				"RDB\$VALID_BLR"
      			FROM "RDB\$PROCEDURES"
      			ORDER BY "RDB\$PROCEDURE_NAME" ASC
      SQL;

      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Return sql to list sequences
      	 *
      	 * @return string
      	 */
      	public function sequence_list()
      	{
      		return <<<SQL
      			SELECT TRIM("RDB\$GENERATOR_NAME")
      			FROM "RDB\$GENERATORS"
      			WHERE "RDB\$SYSTEM_FLAG" = 0
      SQL;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Return sql to list columns of the specified table
      	 *
      	 * @param string $table
      	 * @return string
      	 */
      	public function column_list($table)
      	{
      		return <<<SQL
      			SELECT r.RDB\$FIELD_NAME AS field_name,
      				r.RDB\$DESCRIPTION AS field_description,
      				r.RDB\$DEFAULT_VALUE AS field_default_value,
      				r.RDB\$NULL_FLAG AS field_not_null_constraint,
      				f.RDB\$FIELD_LENGTH AS field_length,
      				f.RDB\$FIELD_PRECISION AS field_precision,
      				f.RDB\$FIELD_SCALE AS field_scale,
      				CASE f.RDB\$FIELD_TYPE
      					WHEN 261 THEN 'BLOB'
      					WHEN 14 THEN 'CHAR'
      					WHEN 40 THEN 'CSTRING'
      					WHEN 11 THEN 'D_FLOAT'
      					WHEN 27 THEN 'DOUBLE'
      					WHEN 10 THEN 'FLOAT'
      					WHEN 16 THEN 'INT64'
      					WHEN 8 THEN 'INTEGER'
      					WHEN 9 THEN 'QUAD'
      					WHEN 7 THEN 'SMALLINT'
      					WHEN 12 THEN 'DATE'
      					WHEN 13 THEN 'TIME'
      					WHEN 35 THEN 'TIMESTAMP'
      					WHEN 37 THEN 'VARCHAR'
      				ELSE 'UNKNOWN'
      				END AS field_type,
      				f.RDB\$FIELD_SUB_TYPE AS field_subtype,
      				coll.RDB\$COLLATION_NAME AS field_collation,
      				cset.RDB\$CHARACTER_SET_NAME AS field_charset
      			FROM RDB\$RELATION_FIELDS r
      			LEFT JOIN RDB\$FIELDS f ON r.RDB\$FIELD_SOURCE = f.RDB\$FIELD_NAME
      			LEFT JOIN RDB\$COLLATIONS coll ON f.RDB\$COLLATION_ID = coll.RDB\$COLLATION_ID
      			LEFT JOIN RDB\$CHARACTER_SETS cset ON f.RDB\$CHARACTER_SET_ID = cset.RDB\$CHARACTER_SET_ID
      			WHERE r.RDB\$RELATION_NAME='{$table}'
      			ORDER BY r.RDB\$FIELD_POSITION
      SQL;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * SQL to show list of field types
      	 *
      	 * @return string
      	 */
      	public function type_list()
      	{
      		return <<<SQL
      			SELECT "RDB\$TYPE_NAME", "RDB\$FIELD_NAME" FROM "RDB\$TYPES"
      			WHERE "RDB\$FIELD_NAME" IN ('RDB\$FIELD_TYPE', 'RDB\$FIELD_SUB_TYPE')
      			ORDER BY "RDB\$FIELD_NAME" DESC, "RDB\$TYPE_NAME" ASC
      SQL;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Get the list of foreign keys for the current
      	 * table
      	 *
      	 * @param string $table
      	 * @return string
      	 */
      	public function fk_list($table)
      	{
      		return <<<SQL
      		SELECT DISTINCT
      			TRIM(d1.RDB\$FIELD_NAME) AS "child_column",
      			TRIM(d2.RDB\$DEPENDED_ON_NAME) AS "parent_table",
      			TRIM(d2.RDB\$FIELD_NAME) AS "parent_column",
      			TRIM(refc.RDB\$UPDATE_RULE) AS "update",
      			TRIM(refc.RDB\$DELETE_RULE) AS "delete"
      		FROM RDB\$RELATION_CONSTRAINTS AS rc
      		LEFT JOIN RDB\$REF_CONSTRAINTS refc ON rc.RDB\$CONSTRAINT_NAME = refc.RDB\$CONSTRAINT_NAME
      		LEFT JOIN RDB\$DEPENDENCIES d1 ON d1.RDB\$DEPENDED_ON_NAME = rc.RDB\$RELATION_NAME
      		LEFT JOIN RDB\$DEPENDENCIES d2 ON d1.RDB\$DEPENDENT_NAME = d2.RDB\$DEPENDENT_NAME
      		WHERE rc.RDB\$CONSTRAINT_TYPE = 'FOREIGN KEY'
      			AND d1.RDB\$DEPENDED_ON_NAME <> d2.RDB\$DEPENDED_ON_NAME
      			AND d1.RDB\$FIELD_NAME <> d2.RDB\$FIELD_NAME
      			AND rc.RDB\$RELATION_NAME = '{$table}'  -- table name
      SQL;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Get the list of indexes for the current table
      	 *
      	 * @param string $table
      	 * @return array
      	 */
      	public function index_list($table)
      	{
      		return <<<SQL
      			SELECT "RDB\$INDEX_NAME", "RDB\$UNIQUE_FLAG", "RDB\$FOREIGN_KEY"
      			FROM "RDB\$INDICES"
      			WHERE "RDB\$RELATION_NAME"='{$table}'
      SQL;
      	}
      }
      //End of firebird_sql.php
      Generated using phpDox 0.8.2-dev - Copyright (C) 2010 - 2015 by Arne Blankerts
      diff --git a/docs/source/Query/Drivers/Firebird/Util.php.html b/docs/source/Query/Drivers/Firebird/Util.php.html index f55dffa..f376ec7 100644 --- a/docs/source/Query/Drivers/Firebird/Util.php.html +++ b/docs/source/Query/Drivers/Firebird/Util.php.html @@ -1,3 +1,3 @@ phpDox - Source of Util.php

      Source of file Util.php

      - Size: 3,273 Bytes - Last Modified: 2015-07-30T14:27:38-04:00

      ../src/Query/Drivers/Firebird/Util.php

      123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
      <?php
      /**
       * Query
       *
       * Free Query Builder / Database Abstraction Layer
       *
       * @package		Query
       * @author		Timothy J. Warren
       * @copyright	Copyright (c) 2012 - 2014
       * @link 		https://github.com/aviat4ion/Query
       * @license		http://philsturgeon.co.uk/code/dbad-license
       */

      // --------------------------------------------------------------------------

      namespace Query\Drivers\Firebird;

      /**
       * Firebird-specific backup, import and creation methods
       *
       * @package Query
       * @subpackage Drivers
       */
      class Util extends \Query\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
      	 * @param bool $if_not_exists
      	 * @return string
      	 */
      	public function create_table($name, $fields, array $constraints=array(), $if_not_exists=FALSE)
      	{
      		return parent::create_table($name, $fields, $constraints, FALSE);
      	}

      	/**
      	 * Drop the selected table
      	 *
      	 * @param string $name
      	 * @return string
      	 */
      	public function delete_table($name)
      	{
      		return 'DROP TABLE '.$this->get_driver()->quote_table($name);
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Create an SQL backup file for the current database's structure
      	 *
      	 * @param string $db_path
      	 * @param string $new_file
      	 * @return string
      	 */
      	public function backup_structure()
      	{
      		list($db_path, $new_file) = func_get_args();
      		return ibase_backup($this->get_driver()->get_service(), $db_path, $new_file, \IBASE_BKP_METADATA_ONLY);
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Create an SQL backup file for the current database's data
      	 *
      	 * @param array $exclude
      	 * @param bool $system_tables
      	 * @return string
      	 */
      	public function backup_data($exclude=array(), $system_tables=FALSE)
      	{
      		// Determine which tables to use
      		$tables = $this->get_driver()->get_tables();
      		if($system_tables == TRUE)
      		{
      			$tables = array_merge($tables, $this->get_driver()->get_system_tables());
      		}

      		// Filter out the tables you don't want
      		if( ! empty($exclude))
      		{
      			$tables = array_diff($tables, $exclude);
      		}

      		$output_sql = '';

      		// Get the data for each object
      		foreach($tables as $t)
      		{
      			$sql = 'SELECT * FROM "'.trim($t).'"';
      			$res = $this->get_driver()->query($sql);
      			$obj_res = $res->fetchAll(\PDO::FETCH_ASSOC);

      			// Don't add to the file if the table is empty
      			if (count($obj_res) < 1) continue;

      			// Nab the column names by getting the keys of the first row
      			$columns = @array_keys($obj_res[0]);

      			$insert_rows = array();

      			// Create the insert statements
      			foreach($obj_res as $row)
      			{
      				$row = array_values($row);

      				// Quote values as needed by type
      				if(stripos($t, 'RDB$') === FALSE)
      				{
      					$row = array_map(array($this->get_driver(), 'quote'), $row);
      					$row = array_map('trim', $row);
      				}

      				$row_string = 'INSERT INTO "'.trim($t).'" ("'.implode('","', $columns).'") VALUES ('.implode(',', $row).');';

      				$row = NULL;

      				$insert_rows[] = $row_string;
      			}

      			$output_sql .= "\n\nSET TRANSACTION;\n".implode("\n", $insert_rows)."\nCOMMIT;";
      		}

      		return $output_sql;
      	}
      }
      // End of firebird_util.php
      Generated using phpDox 0.8.2-dev - Copyright (C) 2010 - 2015 by Arne Blankerts
      + Size: 3,272 Bytes - Last Modified: 2015-11-10T10:04:57-05:00

      ../src/Query/Drivers/Firebird/Util.php

      123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
      <?php
      /**
       * Query
       *
       * Free Query Builder / Database Abstraction Layer
       *
       * @package		Query
       * @author		Timothy J. Warren
       * @copyright	Copyright (c) 2012 - 2014
       * @link 		https://github.com/aviat4ion/Query
       * @license		http://philsturgeon.co.uk/code/dbad-license
       */

      // --------------------------------------------------------------------------

      namespace Query\Drivers\Firebird;

      /**
       * Firebird-specific backup, import and creation methods
       *
       * @package Query
       * @subpackage Drivers
       */
      class Util extends \Query\AbstractUtil {

      	/**
      	 * 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
      	 * @param bool $if_not_exists
      	 * @return string
      	 */
      	public function create_table($name, $fields, array $constraints=array(), $if_not_exists=FALSE)
      	{
      		return parent::create_table($name, $fields, $constraints, FALSE);
      	}

      	/**
      	 * Drop the selected table
      	 *
      	 * @param string $name
      	 * @return string
      	 */
      	public function delete_table($name)
      	{
      		return 'DROP TABLE '.$this->get_driver()->quote_table($name);
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Create an SQL backup file for the current database's structure
      	 *
      	 * @param string $db_path
      	 * @param string $new_file
      	 * @return string
      	 */
      	public function backup_structure()
      	{
      		list($db_path, $new_file) = func_get_args();
      		return ibase_backup($this->get_driver()->get_service(), $db_path, $new_file, \IBASE_BKP_METADATA_ONLY);
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Create an SQL backup file for the current database's data
      	 *
      	 * @param array $exclude
      	 * @param bool $system_tables
      	 * @return string
      	 */
      	public function backup_data($exclude=array(), $system_tables=FALSE)
      	{
      		// Determine which tables to use
      		$tables = $this->get_driver()->get_tables();
      		if($system_tables == TRUE)
      		{
      			$tables = array_merge($tables, $this->get_driver()->get_system_tables());
      		}

      		// Filter out the tables you don't want
      		if( ! empty($exclude))
      		{
      			$tables = array_diff($tables, $exclude);
      		}

      		$output_sql = '';

      		// Get the data for each object
      		foreach($tables as $t)
      		{
      			$sql = 'SELECT * FROM "'.trim($t).'"';
      			$res = $this->get_driver()->query($sql);
      			$obj_res = $res->fetchAll(\PDO::FETCH_ASSOC);

      			// Don't add to the file if the table is empty
      			if (count($obj_res) < 1) continue;

      			// Nab the column names by getting the keys of the first row
      			$columns = @array_keys($obj_res[0]);

      			$insert_rows = array();

      			// Create the insert statements
      			foreach($obj_res as $row)
      			{
      				$row = array_values($row);

      				// Quote values as needed by type
      				if(stripos($t, 'RDB$') === FALSE)
      				{
      					$row = array_map(array($this->get_driver(), 'quote'), $row);
      					$row = array_map('trim', $row);
      				}

      				$row_string = 'INSERT INTO "'.trim($t).'" ("'.implode('","', $columns).'") VALUES ('.implode(',', $row).');';

      				$row = NULL;

      				$insert_rows[] = $row_string;
      			}

      			$output_sql .= "\n\nSET TRANSACTION;\n".implode("\n", $insert_rows)."\nCOMMIT;";
      		}

      		return $output_sql;
      	}
      }
      // End of firebird_util.php
      Generated using phpDox 0.8.2-dev - Copyright (C) 2010 - 2015 by Arne Blankerts
      diff --git a/docs/source/Query/Drivers/Mysql/Driver.php.html b/docs/source/Query/Drivers/Mysql/Driver.php.html index 726e959..481f47b 100644 --- a/docs/source/Query/Drivers/Mysql/Driver.php.html +++ b/docs/source/Query/Drivers/Mysql/Driver.php.html @@ -1,3 +1,3 @@ phpDox - Source of Driver.php

      Source of file Driver.php

      - Size: 1,250 Bytes - Last Modified: 2015-07-30T16:32:24-04:00

      ../src/Query/Drivers/Mysql/Driver.php

      123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
      <?php
      /**
       * Query
       *
       * Free Query Builder / Database Abstraction Layer
       *
       * @package		Query
       * @author		Timothy J. Warren
       * @copyright	Copyright (c) 2012 - 2014
       * @link 		https://github.com/aviat4ion/Query
       * @license		http://philsturgeon.co.uk/code/dbad-license
       */

      // --------------------------------------------------------------------------

      namespace Query\Drivers\Mysql;

      /**
       * MySQL specific class
       *
       * @package Query
       * @subpackage Drivers
       */
      class Driver extends \Query\Abstract_Driver {

      	/**
      	 * Set the backtick as the MySQL escape character
      	 *
      	 * @var string
      	 */
      	protected $escape_char = '`';

      	/**
      	 * Connect to MySQL Database
      	 *
      	 * @codeCoverageIgnore
      	 * @param string $dsn
      	 * @param string $username
      	 * @param string $password
      	 * @param array $options
      	 */
      	public function __construct($dsn, $username=null, $password=null, array $options=array())
      	{
      		// Set the charset to UTF-8
      		if (defined('\\PDO::MYSQL_ATTR_INIT_COMMAND'))
      		{
      			$options = array_merge($options, array(
      				\PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES UTF-8 COLLATE 'UTF-8'",
      			));
      		}

      		if (strpos($dsn, 'mysql') === FALSE) $dsn = 'mysql:'.$dsn;

      		parent::__construct($dsn, $username, $password, $options);
      	}
      }
      //End of mysql_driver.php
      Generated using phpDox 0.8.2-dev - Copyright (C) 2010 - 2015 by Arne Blankerts
      + Size: 1,249 Bytes - Last Modified: 2015-11-10T09:58:22-05:00

      ../src/Query/Drivers/Mysql/Driver.php

      123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
      <?php
      /**
       * Query
       *
       * Free Query Builder / Database Abstraction Layer
       *
       * @package		Query
       * @author		Timothy J. Warren
       * @copyright	Copyright (c) 2012 - 2014
       * @link 		https://github.com/aviat4ion/Query
       * @license		http://philsturgeon.co.uk/code/dbad-license
       */

      // --------------------------------------------------------------------------

      namespace Query\Drivers\Mysql;

      /**
       * MySQL specific class
       *
       * @package Query
       * @subpackage Drivers
       */
      class Driver extends \Query\AbstractDriver {

      	/**
      	 * Set the backtick as the MySQL escape character
      	 *
      	 * @var string
      	 */
      	protected $escape_char = '`';

      	/**
      	 * Connect to MySQL Database
      	 *
      	 * @codeCoverageIgnore
      	 * @param string $dsn
      	 * @param string $username
      	 * @param string $password
      	 * @param array $options
      	 */
      	public function __construct($dsn, $username=null, $password=null, array $options=array())
      	{
      		// Set the charset to UTF-8
      		if (defined('\\PDO::MYSQL_ATTR_INIT_COMMAND'))
      		{
      			$options = array_merge($options, array(
      				\PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES UTF-8 COLLATE 'UTF-8'",
      			));
      		}

      		if (strpos($dsn, 'mysql') === FALSE) $dsn = 'mysql:'.$dsn;

      		parent::__construct($dsn, $username, $password, $options);
      	}
      }
      //End of mysql_driver.php
      Generated using phpDox 0.8.2-dev - Copyright (C) 2010 - 2015 by Arne Blankerts
      diff --git a/docs/source/Query/Drivers/Mysql/SQL.php.html b/docs/source/Query/Drivers/Mysql/SQL.php.html index 335d48d..33bfb24 100644 --- a/docs/source/Query/Drivers/Mysql/SQL.php.html +++ b/docs/source/Query/Drivers/Mysql/SQL.php.html @@ -1,3 +1,3 @@ phpDox - Source of SQL.php

      Source of file SQL.php

      - Size: 4,925 Bytes - Last Modified: 2015-07-16T15:16:55-04:00

      ../src/Query/Drivers/Mysql/SQL.php

      123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234
      <?php
      /**
       * Query
       *
       * Free Query Builder / Database Abstraction Layer
       *
       * @package		Query
       * @author		Timothy J. Warren
       * @copyright	Copyright (c) 2012 - 2014
       * @link 		https://github.com/aviat4ion/Query
       * @license		http://philsturgeon.co.uk/code/dbad-license
       */

      // --------------------------------------------------------------------------

      namespace Query\Drivers\Mysql;

      /**
       * MySQL specifc SQL
       *
       * @package Query
       * @subpackage Drivers
       */
      class SQL extends \Query\Abstract_SQL {

      	/**
      	 * Limit clause
      	 *
      	 * @param string $sql
      	 * @param int $limit
      	 * @param int $offset
      	 * @return string
      	 */
      	public function limit($sql, $limit, $offset=FALSE)
      	{
      		if ( ! is_numeric($offset))
      		{
      			return $sql." LIMIT {$limit}";
      		}

      		return $sql." LIMIT {$offset}, {$limit}";
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Get the query plan for the sql query
      	 *
      	 * @param string $sql
      	 * @return string
      	 */
      	public function explain($sql)
      	{
      		return "EXPLAIN EXTENDED {$sql}";
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Random ordering keyword
      	 *
      	 * @return string
      	 */
      	public function random()
      	{
      		return ' RAND() DESC';
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Returns sql to list other databases
      	 *
      	 * @return string
      	 */
      	public function db_list()
      	{
      		return "SHOW DATABASES WHERE `Database` NOT IN ('information_schema','mysql')";
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Returns sql to list tables
      	 *
      	 * @param string $database
      	 * @return string
      	 */
      	public function table_list($database='')
      	{
      		if ( ! empty($database)) return "SHOW TABLES FROM `{$database}`";

      		return 'SHOW TABLES';
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Overridden in MySQL class
      	 *
      	 * @return string
      	 */
      	public function system_table_list()
      	{
      		return 'SELECT `TABLE_NAME` FROM `information_schema`.`TABLES`
      			WHERE `TABLE_SCHEMA`=\'information_schema\'';
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Returns sql to list views
      	 *
      	 * @return string
      	 */
      	public function view_list()
      	{
      		return 'SELECT `table_name` FROM `information_schema`.`views`';
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Returns sql to list triggers
      	 *
      	 * @return string
      	 */
      	public function trigger_list()
      	{
      		return 'SHOW TRIGGERS';
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Return sql to list functions
      	 *
      	 * @return string
      	 */
      	public function function_list()
      	{
      		return 'SHOW FUNCTION STATUS';
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Return sql to list stored procedures
      	 *
      	 * @return string
      	 */
      	public function procedure_list()
      	{
      		return 'SHOW PROCEDURE STATUS';
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Return sql to list sequences
      	 *
      	 * @return NULL
      	 */
      	public function sequence_list()
      	{
      		return NULL;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * SQL to show list of field types
      	 *
      	 * @return string
      	 */
      	public function type_list()
      	{
      		return "SELECT DISTINCT `DATA_TYPE` FROM `information_schema`.`COLUMNS`";
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * SQL to show infromation about columns in a table
      	 *
      	 * @param string $table
      	 * @return string
      	 */
      	public function column_list($table)
      	{
      		return "SHOW FULL COLUMNS FROM {$table}";
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Get the list of foreign keys for the current
      	 * table
      	 *
      	 * @param string $table
      	 * @return string
      	 */
      	public function fk_list($table)
      	{
      		return <<<SQL
      			SELECT DISTINCT `kcu`.`COLUMN_NAME` as `child_column`,
      					`kcu`.`REFERENCED_TABLE_NAME` as `parent_table`,
      					`kcu`.`REFERENCED_COLUMN_NAME` as `parent_column`,
      					`rc`.`UPDATE_RULE` AS `update`,
      					`rc`.`DELETE_RULE` AS `delete`
      			FROM `INFORMATION_SCHEMA`.`TABLE_CONSTRAINTS` `tc`
      			INNER JOIN `INFORMATION_SCHEMA`.`KEY_COLUMN_USAGE` `kcu`
      				ON `kcu`.`CONSTRAINT_NAME`=`tc`.`CONSTRAINT_NAME`
      			INNER JOIN `INFORMATION_SCHEMA`.`REFERENTIAL_CONSTRAINTS` `rc`
      				ON `rc`.`CONSTRAINT_NAME`=`tc`.`CONSTRAINT_NAME`
      			WHERE `tc`.`CONSTRAINT_TYPE`='FOREIGN KEY'
      			AND `tc`.`TABLE_NAME`='{$table}'
      SQL;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Get the list of indexes for the current table
      	 *
      	 * @param string $table
      	 * @return array
      	 */
      	public function index_list($table)
      	{
      		return "SHOW INDEX IN {$table}";
      	}
      }
      //End of mysql_sql.php
      Generated using phpDox 0.8.2-dev - Copyright (C) 2010 - 2015 by Arne Blankerts
      + Size: 4,924 Bytes - Last Modified: 2015-11-10T10:05:02-05:00

      ../src/Query/Drivers/Mysql/SQL.php

      123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234
      <?php
      /**
       * Query
       *
       * Free Query Builder / Database Abstraction Layer
       *
       * @package		Query
       * @author		Timothy J. Warren
       * @copyright	Copyright (c) 2012 - 2014
       * @link 		https://github.com/aviat4ion/Query
       * @license		http://philsturgeon.co.uk/code/dbad-license
       */

      // --------------------------------------------------------------------------

      namespace Query\Drivers\Mysql;

      /**
       * MySQL specifc SQL
       *
       * @package Query
       * @subpackage Drivers
       */
      class SQL extends \Query\AbstractSQL {

      	/**
      	 * Limit clause
      	 *
      	 * @param string $sql
      	 * @param int $limit
      	 * @param int $offset
      	 * @return string
      	 */
      	public function limit($sql, $limit, $offset=FALSE)
      	{
      		if ( ! is_numeric($offset))
      		{
      			return $sql." LIMIT {$limit}";
      		}

      		return $sql." LIMIT {$offset}, {$limit}";
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Get the query plan for the sql query
      	 *
      	 * @param string $sql
      	 * @return string
      	 */
      	public function explain($sql)
      	{
      		return "EXPLAIN EXTENDED {$sql}";
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Random ordering keyword
      	 *
      	 * @return string
      	 */
      	public function random()
      	{
      		return ' RAND() DESC';
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Returns sql to list other databases
      	 *
      	 * @return string
      	 */
      	public function db_list()
      	{
      		return "SHOW DATABASES WHERE `Database` NOT IN ('information_schema','mysql')";
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Returns sql to list tables
      	 *
      	 * @param string $database
      	 * @return string
      	 */
      	public function table_list($database='')
      	{
      		if ( ! empty($database)) return "SHOW TABLES FROM `{$database}`";

      		return 'SHOW TABLES';
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Overridden in MySQL class
      	 *
      	 * @return string
      	 */
      	public function system_table_list()
      	{
      		return 'SELECT `TABLE_NAME` FROM `information_schema`.`TABLES`
      			WHERE `TABLE_SCHEMA`=\'information_schema\'';
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Returns sql to list views
      	 *
      	 * @return string
      	 */
      	public function view_list()
      	{
      		return 'SELECT `table_name` FROM `information_schema`.`views`';
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Returns sql to list triggers
      	 *
      	 * @return string
      	 */
      	public function trigger_list()
      	{
      		return 'SHOW TRIGGERS';
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Return sql to list functions
      	 *
      	 * @return string
      	 */
      	public function function_list()
      	{
      		return 'SHOW FUNCTION STATUS';
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Return sql to list stored procedures
      	 *
      	 * @return string
      	 */
      	public function procedure_list()
      	{
      		return 'SHOW PROCEDURE STATUS';
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Return sql to list sequences
      	 *
      	 * @return NULL
      	 */
      	public function sequence_list()
      	{
      		return NULL;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * SQL to show list of field types
      	 *
      	 * @return string
      	 */
      	public function type_list()
      	{
      		return "SELECT DISTINCT `DATA_TYPE` FROM `information_schema`.`COLUMNS`";
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * SQL to show infromation about columns in a table
      	 *
      	 * @param string $table
      	 * @return string
      	 */
      	public function column_list($table)
      	{
      		return "SHOW FULL COLUMNS FROM {$table}";
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Get the list of foreign keys for the current
      	 * table
      	 *
      	 * @param string $table
      	 * @return string
      	 */
      	public function fk_list($table)
      	{
      		return <<<SQL
      			SELECT DISTINCT `kcu`.`COLUMN_NAME` as `child_column`,
      					`kcu`.`REFERENCED_TABLE_NAME` as `parent_table`,
      					`kcu`.`REFERENCED_COLUMN_NAME` as `parent_column`,
      					`rc`.`UPDATE_RULE` AS `update`,
      					`rc`.`DELETE_RULE` AS `delete`
      			FROM `INFORMATION_SCHEMA`.`TABLE_CONSTRAINTS` `tc`
      			INNER JOIN `INFORMATION_SCHEMA`.`KEY_COLUMN_USAGE` `kcu`
      				ON `kcu`.`CONSTRAINT_NAME`=`tc`.`CONSTRAINT_NAME`
      			INNER JOIN `INFORMATION_SCHEMA`.`REFERENTIAL_CONSTRAINTS` `rc`
      				ON `rc`.`CONSTRAINT_NAME`=`tc`.`CONSTRAINT_NAME`
      			WHERE `tc`.`CONSTRAINT_TYPE`='FOREIGN KEY'
      			AND `tc`.`TABLE_NAME`='{$table}'
      SQL;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Get the list of indexes for the current table
      	 *
      	 * @param string $table
      	 * @return array
      	 */
      	public function index_list($table)
      	{
      		return "SHOW INDEX IN {$table}";
      	}
      }
      //End of mysql_sql.php
      Generated using phpDox 0.8.2-dev - Copyright (C) 2010 - 2015 by Arne Blankerts
      diff --git a/docs/source/Query/Drivers/Mysql/Util.php.html b/docs/source/Query/Drivers/Mysql/Util.php.html index fdbd168..1e8361f 100644 --- a/docs/source/Query/Drivers/Mysql/Util.php.html +++ b/docs/source/Query/Drivers/Mysql/Util.php.html @@ -1,3 +1,3 @@ phpDox - Source of Util.php

      Source of file Util.php

      - Size: 2,601 Bytes - Last Modified: 2015-07-16T15:17:32-04:00

      ../src/Query/Drivers/Mysql/Util.php

      123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
      <?php
      /**
       * Query
       *
       * Free Query Builder / Database Abstraction Layer
       *
       * @package		Query
       * @author		Timothy J. Warren
       * @copyright	Copyright (c) 2012 - 2014
       * @link 		https://github.com/aviat4ion/Query
       * @license		http://philsturgeon.co.uk/code/dbad-license
       */

      // --------------------------------------------------------------------------

      namespace Query\Drivers\Mysql;

      /**
       * MySQL-specific backup, import and creation methods
       *
       * @package Query
       * @subpackage Drivers
       */
      class Util extends \Query\Abstract_Util {

      	/**
      	 * Create an SQL backup file for the current database's structure
      	 *
      	 * @return string
      	 */
      	public function backup_structure()
      	{
      		$string = array();

      		// Get databases
      		$dbs = $this->get_driver()->get_dbs();

      		foreach($dbs as &$d)
      		{
      			// Skip built-in dbs
      			if ($d == 'mysql') continue;

      			// Get the list of tables
      			$tables = $this->get_driver()->driver_query("SHOW TABLES FROM `{$d}`", TRUE);

      			foreach($tables as $table)
      			{
      				$array = $this->get_driver()->driver_query("SHOW CREATE TABLE `{$d}`.`{$table}`", FALSE);
      				$row = current($array);

      				if ( ! isset($row['Create Table'])) continue;


      				$string[] = $row['Create Table'];
      			}
      		}

      		return implode("\n\n", $string);
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Create an SQL backup file for the current database's data
      	 *
      	 * @param array $exclude
      	 * @return string
      	 */
      	public function backup_data($exclude=array())
      	{
      		$tables = $this->get_driver()->get_tables();

      		// Filter out the tables you don't want
      		if( ! empty($exclude))
      		{
      			$tables = array_diff($tables, $exclude);
      		}

      		$output_sql = '';

      		// Select the rows from each Table
      		foreach($tables as $t)
      		{
      			$sql = "SELECT * FROM `{$t}`";
      			$res = $this->get_driver()->query($sql);
      			$rows = $res->fetchAll(\PDO::FETCH_ASSOC);

      			// Skip empty tables
      			if (count($rows) < 1) continue;

      			// Nab the column names by getting the keys of the first row
      			$columns = @array_keys($rows[0]);

      			$insert_rows = array();

      			// Create the insert statements
      			foreach($rows as $row)
      			{
      				$row = array_values($row);

      				// Workaround for Quercus
      				foreach($row as &$r)
      				{
      					$r = $this->get_driver()->quote($r);
      				}
      				$row = array_map('trim', $row);

      				$row_string = 'INSERT INTO `'.trim($t).'` (`'.implode('`,`', $columns).'`) VALUES ('.implode(',', $row).');';

      				$row = NULL;

      				$insert_rows[] = $row_string;
      			}

      			$output_sql .= "\n\n".implode("\n", $insert_rows)."\n";
      		}

      		return $output_sql;
      	}
      }
      // End of mysql_util.php

      Generated using phpDox 0.8.2-dev - Copyright (C) 2010 - 2015 by Arne Blankerts
      + Size: 2,600 Bytes - Last Modified: 2015-11-10T10:05:07-05:00

      ../src/Query/Drivers/Mysql/Util.php

      123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
      <?php
      /**
       * Query
       *
       * Free Query Builder / Database Abstraction Layer
       *
       * @package		Query
       * @author		Timothy J. Warren
       * @copyright	Copyright (c) 2012 - 2014
       * @link 		https://github.com/aviat4ion/Query
       * @license		http://philsturgeon.co.uk/code/dbad-license
       */

      // --------------------------------------------------------------------------

      namespace Query\Drivers\Mysql;

      /**
       * MySQL-specific backup, import and creation methods
       *
       * @package Query
       * @subpackage Drivers
       */
      class Util extends \Query\AbstractUtil {

      	/**
      	 * Create an SQL backup file for the current database's structure
      	 *
      	 * @return string
      	 */
      	public function backup_structure()
      	{
      		$string = array();

      		// Get databases
      		$dbs = $this->get_driver()->get_dbs();

      		foreach($dbs as &$d)
      		{
      			// Skip built-in dbs
      			if ($d == 'mysql') continue;

      			// Get the list of tables
      			$tables = $this->get_driver()->driver_query("SHOW TABLES FROM `{$d}`", TRUE);

      			foreach($tables as $table)
      			{
      				$array = $this->get_driver()->driver_query("SHOW CREATE TABLE `{$d}`.`{$table}`", FALSE);
      				$row = current($array);

      				if ( ! isset($row['Create Table'])) continue;


      				$string[] = $row['Create Table'];
      			}
      		}

      		return implode("\n\n", $string);
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Create an SQL backup file for the current database's data
      	 *
      	 * @param array $exclude
      	 * @return string
      	 */
      	public function backup_data($exclude=array())
      	{
      		$tables = $this->get_driver()->get_tables();

      		// Filter out the tables you don't want
      		if( ! empty($exclude))
      		{
      			$tables = array_diff($tables, $exclude);
      		}

      		$output_sql = '';

      		// Select the rows from each Table
      		foreach($tables as $t)
      		{
      			$sql = "SELECT * FROM `{$t}`";
      			$res = $this->get_driver()->query($sql);
      			$rows = $res->fetchAll(\PDO::FETCH_ASSOC);

      			// Skip empty tables
      			if (count($rows) < 1) continue;

      			// Nab the column names by getting the keys of the first row
      			$columns = @array_keys($rows[0]);

      			$insert_rows = array();

      			// Create the insert statements
      			foreach($rows as $row)
      			{
      				$row = array_values($row);

      				// Workaround for Quercus
      				foreach($row as &$r)
      				{
      					$r = $this->get_driver()->quote($r);
      				}
      				$row = array_map('trim', $row);

      				$row_string = 'INSERT INTO `'.trim($t).'` (`'.implode('`,`', $columns).'`) VALUES ('.implode(',', $row).');';

      				$row = NULL;

      				$insert_rows[] = $row_string;
      			}

      			$output_sql .= "\n\n".implode("\n", $insert_rows)."\n";
      		}

      		return $output_sql;
      	}
      }
      // End of mysql_util.php

      Generated using phpDox 0.8.2-dev - Copyright (C) 2010 - 2015 by Arne Blankerts
      diff --git a/docs/source/Query/Drivers/Pgsql/Driver.php.html b/docs/source/Query/Drivers/Pgsql/Driver.php.html index 9dcacb1..dfba345 100644 --- a/docs/source/Query/Drivers/Pgsql/Driver.php.html +++ b/docs/source/Query/Drivers/Pgsql/Driver.php.html @@ -1,3 +1,3 @@ phpDox - Source of Driver.php

      Source of file Driver.php

      - Size: 1,860 Bytes - Last Modified: 2015-07-30T16:32:38-04:00

      ../src/Query/Drivers/Pgsql/Driver.php

      123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
      <?php
      /**
       * Query
       *
       * Free Query Builder / Database Abstraction Layer
       *
       * @package		Query
       * @author		Timothy J. Warren
       * @copyright	Copyright (c) 2012 - 2014
       * @link 		https://github.com/aviat4ion/Query
       * @license		http://philsturgeon.co.uk/code/dbad-license
       */

      // --------------------------------------------------------------------------

      namespace Query\Drivers\Pgsql;

      /**
       * PostgreSQL specifc class
       *
       * @package Query
       * @subpackage Drivers
       */
      class Driver extends \Query\Abstract_Driver {

      	/**
      	 * Connect to a PosgreSQL database
      	 *
      	 * @codeCoverageIgnore
      	 * @param string $dsn
      	 * @param string $username
      	 * @param string $password
      	 * @param array  $options
      	 */
      	public function __construct($dsn, $username=null, $password=null, array $options=array())
      	{
      		if (strpos($dsn, 'pgsql') === FALSE) $dsn = 'pgsql:'.$dsn;

      		parent::__construct($dsn, $username, $password, $options);
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Get a list of schemas for the current connection
      	 *
      	 * @return array
      	 */
      	public function get_schemas()
      	{
      		$sql = <<<SQL
      			SELECT DISTINCT "schemaname" FROM "pg_tables"
      			WHERE "schemaname" NOT LIKE 'pg\_%'
      			AND "schemaname" != 'information_schema'
      SQL;

      		return $this->driver_query($sql);
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Retrieve foreign keys for the table
      	 *
      	 * @param string $table
      	 * @return array
      	 */
      	public function get_fks($table)
      	{
      		$value_map = array(
      			'c' => 'CASCADE',
      			'r' => 'RESTRICT',
      		);

      		$keys = parent::get_fks($table);

      		foreach($keys as &$key)
      		{
      			foreach(array('update', 'delete') AS $type)
      			{
      				if ( ! isset($value_map[$key[$type]])) continue;

      				$key[$type] = $value_map[$key[$type]];
      			}
      		}

      		return $keys;
      	}
      }
      //End of pgsql_driver.php
      Generated using phpDox 0.8.2-dev - Copyright (C) 2010 - 2015 by Arne Blankerts
      + Size: 1,859 Bytes - Last Modified: 2015-11-10T09:58:17-05:00

      ../src/Query/Drivers/Pgsql/Driver.php

      123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
      <?php
      /**
       * Query
       *
       * Free Query Builder / Database Abstraction Layer
       *
       * @package		Query
       * @author		Timothy J. Warren
       * @copyright	Copyright (c) 2012 - 2014
       * @link 		https://github.com/aviat4ion/Query
       * @license		http://philsturgeon.co.uk/code/dbad-license
       */

      // --------------------------------------------------------------------------

      namespace Query\Drivers\Pgsql;

      /**
       * PostgreSQL specifc class
       *
       * @package Query
       * @subpackage Drivers
       */
      class Driver extends \Query\AbstractDriver {

      	/**
      	 * Connect to a PosgreSQL database
      	 *
      	 * @codeCoverageIgnore
      	 * @param string $dsn
      	 * @param string $username
      	 * @param string $password
      	 * @param array  $options
      	 */
      	public function __construct($dsn, $username=null, $password=null, array $options=array())
      	{
      		if (strpos($dsn, 'pgsql') === FALSE) $dsn = 'pgsql:'.$dsn;

      		parent::__construct($dsn, $username, $password, $options);
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Get a list of schemas for the current connection
      	 *
      	 * @return array
      	 */
      	public function get_schemas()
      	{
      		$sql = <<<SQL
      			SELECT DISTINCT "schemaname" FROM "pg_tables"
      			WHERE "schemaname" NOT LIKE 'pg\_%'
      			AND "schemaname" != 'information_schema'
      SQL;

      		return $this->driver_query($sql);
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Retrieve foreign keys for the table
      	 *
      	 * @param string $table
      	 * @return array
      	 */
      	public function get_fks($table)
      	{
      		$value_map = array(
      			'c' => 'CASCADE',
      			'r' => 'RESTRICT',
      		);

      		$keys = parent::get_fks($table);

      		foreach($keys as &$key)
      		{
      			foreach(array('update', 'delete') AS $type)
      			{
      				if ( ! isset($value_map[$key[$type]])) continue;

      				$key[$type] = $value_map[$key[$type]];
      			}
      		}

      		return $keys;
      	}
      }
      //End of pgsql_driver.php
      Generated using phpDox 0.8.2-dev - Copyright (C) 2010 - 2015 by Arne Blankerts
      diff --git a/docs/source/Query/Drivers/Pgsql/SQL.php.html b/docs/source/Query/Drivers/Pgsql/SQL.php.html index 7854237..f72fcce 100644 --- a/docs/source/Query/Drivers/Pgsql/SQL.php.html +++ b/docs/source/Query/Drivers/Pgsql/SQL.php.html @@ -1,3 +1,3 @@ phpDox - Source of SQL.php

      Source of file SQL.php

      - Size: 6,347 Bytes - Last Modified: 2015-07-30T14:30:12-04:00

      ../src/Query/Drivers/Pgsql/SQL.php

      123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304
      <?php
      /**
       * Query
       *
       * Free Query Builder / Database Abstraction Layer
       *
       * @author 		Timothy J. Warren
       * @copyright	Copyright (c) 2012 - 2014
       * @link 		https://github.com/aviat4ion/Query
       * @license 	http://philsturgeon.co.uk/code/dbad-license
       */

      // --------------------------------------------------------------------------

      namespace Query\Drivers\Pgsql;

      /**
       * PostgreSQL specifc SQL
       *
       * @package Query
       * @subpackage Drivers
       */
      class SQL extends \Query\Abstract_SQL {

      	/**
      	 * Get the query plan for the sql query
      	 *
      	 * @param string $sql
      	 * @return string
      	 */
      	public function explain($sql)
      	{
      		return "EXPLAIN VERBOSE {$sql}";
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Random ordering keyword
      	 *
      	 * @return string
      	 */
      	public function random()
      	{
      		return ' RANDOM()';
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Returns sql to list other databases
      	 *
      	 * @return string
      	 */
      	public function db_list()
      	{
      		return <<<SQL
      			SELECT "datname" FROM "pg_database"
      			WHERE "datname" NOT IN ('template0','template1')
      			ORDER BY "datname" ASC
      SQL;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Returns sql to list tables
      	 *
      	 * @return string
      	 */
      	public function table_list()
      	{
      		return <<<SQL
      			SELECT "table_name"
      			FROM "information_schema"."tables"
      			WHERE "table_type" = 'BASE TABLE'
      			AND "table_schema" NOT IN
      				('pg_catalog', 'information_schema');
      SQL;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Returns sql to list system tables
      	 *
      	 * @return string
      	 */
      	public function system_table_list()
      	{
      		return <<<SQL
      			SELECT "table_name"
      			FROM "information_schema"."tables"
      			WHERE "table_type" = 'BASE TABLE'
      			AND "table_schema" IN
      				('pg_catalog', 'information_schema');
      SQL;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Returns sql to list views
      	 *
      	 * @return string
      	 */
      	public function view_list()
      	{
      		return <<<SQL
      		 	SELECT "viewname" FROM "pg_views"
      			WHERE "schemaname" NOT IN
      				('pg_catalog', 'information_schema')
      			AND "viewname" !~ '^pg_'
      			ORDER BY "viewname" ASC
      SQL;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Returns sql to list triggers
      	 *
      	 * @return string
      	 */
      	public function trigger_list()
      	{
      		return <<<SQL
      			SELECT *
      			FROM "information_schema"."triggers"
      			WHERE "trigger_schema" NOT IN
      				('pg_catalog', 'information_schema')
      SQL;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Return sql to list functions
      	 *
      	 * @return NULL
      	 */
      	public function function_list()
      	{
      		return NULL;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Return sql to list stored procedures
      	 *
      	 * @return string
      	 */
      	public function procedure_list()
      	{
      		return <<<SQL
      			SELECT "routine_name"
      			FROM "information_schema"."routines"
      			WHERE "specific_schema" NOT IN
      				('pg_catalog', 'information_schema')
      			AND "type_udt_name" != 'trigger';
      SQL;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Return sql to list sequences
      	 *
      	 * @return string
      	 */
      	public function sequence_list()
      	{
      		return <<<SQL
      			SELECT "c"."relname"
      			FROM "pg_class" "c"
      			WHERE "c"."relkind" = 'S'
      			ORDER BY "relname" ASC
      SQL;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Return sql to list columns of the specified table
      	 *
      	 * @param string $table
      	 * @return string
      	 */
      	public function column_list($table)
      	{
      		return <<<SQL
      			SELECT ordinal_position,
      				column_name,
      				data_type,
      				column_default,
      				is_nullable,
      				character_maximum_length,
      				numeric_precision
      			FROM information_schema.columns
      			WHERE table_name = '{$table}'
      			ORDER BY ordinal_position;
      SQL;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * SQL to show list of field types
      	 *
      	 * @return string
      	 */
      	public function type_list()
      	{
      		return <<<SQL
      			SELECT "typname" FROM "pg_catalog"."pg_type"
      			WHERE "typname" !~ '^pg_|_'
      			AND "typtype" = 'b'
      			ORDER BY "typname"
      SQL;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Get the list of foreign keys for the current
      	 * table
      	 *
      	 * @param string $table
      	 * @return string
      	 */
      	public function fk_list($table)
      	{
      		return <<<SQL
      			SELECT
      				"att2"."attname" AS "child_column",
      				"cl"."relname" AS "parent_table",
      				"att"."attname" AS "parent_column",
      				"con"."update" AS "update",
      				"con"."update" AS "delete"
      			FROM
      				(SELECT
      					unnest(con1.conkey) AS "parent",
      					unnest(con1.confkey) AS "child",
      					"con1"."confrelid",
      					"con1"."conrelid",
      					"con1"."confupdtype" as "update",
      					"con1"."confdeltype" as "delete"
      				FROM "pg_class" "cl"
      				JOIN "pg_namespace" "ns" ON "cl"."relnamespace" = "ns"."oid"
      				JOIN "pg_constraint" "con1" ON "con1"."conrelid" = "cl"."oid"
      				WHERE "cl"."relname" = '{$table}'
      					AND "ns"."nspname" = 'public'
      					AND "con1"."contype" = 'f'
      				)
      				"con"
      				JOIN "pg_attribute" "att" ON
      					"att"."attrelid" = "con"."confrelid"
      					AND "att"."attnum" = "con"."child"
      				JOIN "pg_class" "cl" ON
      					"cl"."oid" = "con"."confrelid"
      				JOIN "pg_attribute" "att2" ON
      					"att2"."attrelid" = "con"."conrelid"
      					AND "att2"."attnum" = "con"."parent"
      SQL;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Get the list of indexes for the current table
      	 *
      	 * @param string $table
      	 * @return array
      	 */
      	public function index_list($table)
      	{
      		return <<<SQL
      			SELECT
      				t.relname AS table_name,
      				i.relname AS index_name,
      				array_to_string(array_agg(a.attname), ', ') AS column_names
      			FROM
      				pg_class t,
      				pg_class i,
      				pg_index ix,
      				pg_attribute a
      			WHERE
      				t.oid = ix.indrelid
      				AND i.oid = ix.indexrelid
      				AND a.attrelid = t.oid
      				AND a.attnum = ANY(ix.indkey)
      				AND t.relkind = 'r'
      				AND t.relname = '{$table}'
      			GROUP BY
      				t.relname,
      				i.relname
      			ORDER BY
      				t.relname,
      				i.relname;
      SQL;
      	}
      }
      //End of pgsql_sql.php
      Generated using phpDox 0.8.2-dev - Copyright (C) 2010 - 2015 by Arne Blankerts
      + Size: 6,346 Bytes - Last Modified: 2015-11-10T10:05:13-05:00

      ../src/Query/Drivers/Pgsql/SQL.php

      123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304
      <?php
      /**
       * Query
       *
       * Free Query Builder / Database Abstraction Layer
       *
       * @author 		Timothy J. Warren
       * @copyright	Copyright (c) 2012 - 2014
       * @link 		https://github.com/aviat4ion/Query
       * @license 	http://philsturgeon.co.uk/code/dbad-license
       */

      // --------------------------------------------------------------------------

      namespace Query\Drivers\Pgsql;

      /**
       * PostgreSQL specifc SQL
       *
       * @package Query
       * @subpackage Drivers
       */
      class SQL extends \Query\AbstractSQL {

      	/**
      	 * Get the query plan for the sql query
      	 *
      	 * @param string $sql
      	 * @return string
      	 */
      	public function explain($sql)
      	{
      		return "EXPLAIN VERBOSE {$sql}";
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Random ordering keyword
      	 *
      	 * @return string
      	 */
      	public function random()
      	{
      		return ' RANDOM()';
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Returns sql to list other databases
      	 *
      	 * @return string
      	 */
      	public function db_list()
      	{
      		return <<<SQL
      			SELECT "datname" FROM "pg_database"
      			WHERE "datname" NOT IN ('template0','template1')
      			ORDER BY "datname" ASC
      SQL;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Returns sql to list tables
      	 *
      	 * @return string
      	 */
      	public function table_list()
      	{
      		return <<<SQL
      			SELECT "table_name"
      			FROM "information_schema"."tables"
      			WHERE "table_type" = 'BASE TABLE'
      			AND "table_schema" NOT IN
      				('pg_catalog', 'information_schema');
      SQL;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Returns sql to list system tables
      	 *
      	 * @return string
      	 */
      	public function system_table_list()
      	{
      		return <<<SQL
      			SELECT "table_name"
      			FROM "information_schema"."tables"
      			WHERE "table_type" = 'BASE TABLE'
      			AND "table_schema" IN
      				('pg_catalog', 'information_schema');
      SQL;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Returns sql to list views
      	 *
      	 * @return string
      	 */
      	public function view_list()
      	{
      		return <<<SQL
      		 	SELECT "viewname" FROM "pg_views"
      			WHERE "schemaname" NOT IN
      				('pg_catalog', 'information_schema')
      			AND "viewname" !~ '^pg_'
      			ORDER BY "viewname" ASC
      SQL;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Returns sql to list triggers
      	 *
      	 * @return string
      	 */
      	public function trigger_list()
      	{
      		return <<<SQL
      			SELECT *
      			FROM "information_schema"."triggers"
      			WHERE "trigger_schema" NOT IN
      				('pg_catalog', 'information_schema')
      SQL;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Return sql to list functions
      	 *
      	 * @return NULL
      	 */
      	public function function_list()
      	{
      		return NULL;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Return sql to list stored procedures
      	 *
      	 * @return string
      	 */
      	public function procedure_list()
      	{
      		return <<<SQL
      			SELECT "routine_name"
      			FROM "information_schema"."routines"
      			WHERE "specific_schema" NOT IN
      				('pg_catalog', 'information_schema')
      			AND "type_udt_name" != 'trigger';
      SQL;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Return sql to list sequences
      	 *
      	 * @return string
      	 */
      	public function sequence_list()
      	{
      		return <<<SQL
      			SELECT "c"."relname"
      			FROM "pg_class" "c"
      			WHERE "c"."relkind" = 'S'
      			ORDER BY "relname" ASC
      SQL;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Return sql to list columns of the specified table
      	 *
      	 * @param string $table
      	 * @return string
      	 */
      	public function column_list($table)
      	{
      		return <<<SQL
      			SELECT ordinal_position,
      				column_name,
      				data_type,
      				column_default,
      				is_nullable,
      				character_maximum_length,
      				numeric_precision
      			FROM information_schema.columns
      			WHERE table_name = '{$table}'
      			ORDER BY ordinal_position;
      SQL;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * SQL to show list of field types
      	 *
      	 * @return string
      	 */
      	public function type_list()
      	{
      		return <<<SQL
      			SELECT "typname" FROM "pg_catalog"."pg_type"
      			WHERE "typname" !~ '^pg_|_'
      			AND "typtype" = 'b'
      			ORDER BY "typname"
      SQL;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Get the list of foreign keys for the current
      	 * table
      	 *
      	 * @param string $table
      	 * @return string
      	 */
      	public function fk_list($table)
      	{
      		return <<<SQL
      			SELECT
      				"att2"."attname" AS "child_column",
      				"cl"."relname" AS "parent_table",
      				"att"."attname" AS "parent_column",
      				"con"."update" AS "update",
      				"con"."update" AS "delete"
      			FROM
      				(SELECT
      					unnest(con1.conkey) AS "parent",
      					unnest(con1.confkey) AS "child",
      					"con1"."confrelid",
      					"con1"."conrelid",
      					"con1"."confupdtype" as "update",
      					"con1"."confdeltype" as "delete"
      				FROM "pg_class" "cl"
      				JOIN "pg_namespace" "ns" ON "cl"."relnamespace" = "ns"."oid"
      				JOIN "pg_constraint" "con1" ON "con1"."conrelid" = "cl"."oid"
      				WHERE "cl"."relname" = '{$table}'
      					AND "ns"."nspname" = 'public'
      					AND "con1"."contype" = 'f'
      				)
      				"con"
      				JOIN "pg_attribute" "att" ON
      					"att"."attrelid" = "con"."confrelid"
      					AND "att"."attnum" = "con"."child"
      				JOIN "pg_class" "cl" ON
      					"cl"."oid" = "con"."confrelid"
      				JOIN "pg_attribute" "att2" ON
      					"att2"."attrelid" = "con"."conrelid"
      					AND "att2"."attnum" = "con"."parent"
      SQL;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Get the list of indexes for the current table
      	 *
      	 * @param string $table
      	 * @return array
      	 */
      	public function index_list($table)
      	{
      		return <<<SQL
      			SELECT
      				t.relname AS table_name,
      				i.relname AS index_name,
      				array_to_string(array_agg(a.attname), ', ') AS column_names
      			FROM
      				pg_class t,
      				pg_class i,
      				pg_index ix,
      				pg_attribute a
      			WHERE
      				t.oid = ix.indrelid
      				AND i.oid = ix.indexrelid
      				AND a.attrelid = t.oid
      				AND a.attnum = ANY(ix.indkey)
      				AND t.relkind = 'r'
      				AND t.relname = '{$table}'
      			GROUP BY
      				t.relname,
      				i.relname
      			ORDER BY
      				t.relname,
      				i.relname;
      SQL;
      	}
      }
      //End of pgsql_sql.php
      Generated using phpDox 0.8.2-dev - Copyright (C) 2010 - 2015 by Arne Blankerts
      diff --git a/docs/source/Query/Drivers/Pgsql/Util.php.html b/docs/source/Query/Drivers/Pgsql/Util.php.html index bcced7c..a54b23b 100644 --- a/docs/source/Query/Drivers/Pgsql/Util.php.html +++ b/docs/source/Query/Drivers/Pgsql/Util.php.html @@ -1,3 +1,3 @@ phpDox - Source of Util.php

      Source of file Util.php

      - Size: 2,157 Bytes - Last Modified: 2015-07-16T15:41:16-04:00

      ../src/Query/Drivers/Pgsql/Util.php

      123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
      <?php
      /**
       * Query
       *
       * Free Query Builder / Database Abstraction Layer
       *
       * @package		Query
       * @author		Timothy J. Warren
       * @copyright	Copyright (c) 2012 - 2014
       * @link 		https://github.com/aviat4ion/Query
       * @license		http://philsturgeon.co.uk/code/dbad-license
       */

      // --------------------------------------------------------------------------

      namespace Query\Drivers\Pgsql;

      /**
       * Posgres-specific backup, import and creation methods
       *
       * @package Query
       * @subpackage Drivers
       */
      class Util extends \Query\Abstract_Util {

      	/**
      	 * Create an SQL backup file for the current database's structure
      	 *
      	 * @return string
      	 */
      	public function backup_structure()
      	{
      		// TODO Implement Backup function
      		return '';
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Create an SQL backup file for the current database's data
      	 *
      	 * @param array $exclude
      	 * @return string
      	 */
      	public function backup_data($exclude=array())
      	{
      		$tables = $this->get_driver()->get_tables();

      		// Filter out the tables you don't want
      		if( ! empty($exclude))
      		{
      			$tables = array_diff($tables, $exclude);
      		}

      		$output_sql = '';

      		// Get the data for each object
      		foreach($tables as $t)
      		{
      			$sql = 'SELECT * FROM "'.trim($t).'"';
      			$res = $this->get_driver()->query($sql);
      			$obj_res = $res->fetchAll(\PDO::FETCH_ASSOC);

      			// Don't add to the file if the table is empty
      			if (count($obj_res) < 1) continue;

      			$res = NULL;

      			// Nab the column names by getting the keys of the first row
      			$columns = @array_keys($obj_res[0]);

      			$insert_rows = array();

      			// Create the insert statements
      			foreach($obj_res as $row)
      			{
      				$row = array_values($row);

      				// Quote values as needed by type
      				$row = array_map(array($this->get_driver(), 'quote'), $row);
      				$row = array_map('trim', $row);


      				$row_string = 'INSERT INTO "'.trim($t).'" ("'.implode('","', $columns).'") VALUES ('.implode(',', $row).');';

      				$row = NULL;

      				$insert_rows[] = $row_string;
      			}

      			$obj_res = NULL;

      			$output_sql .= "\n\n".implode("\n", $insert_rows)."\n";
      		}

      		return $output_sql;
      	}
      }
      // End of pgsql_util.php

      Generated using phpDox 0.8.2-dev - Copyright (C) 2010 - 2015 by Arne Blankerts
      + Size: 2,156 Bytes - Last Modified: 2015-11-10T10:05:17-05:00

      ../src/Query/Drivers/Pgsql/Util.php

      123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
      <?php
      /**
       * Query
       *
       * Free Query Builder / Database Abstraction Layer
       *
       * @package		Query
       * @author		Timothy J. Warren
       * @copyright	Copyright (c) 2012 - 2014
       * @link 		https://github.com/aviat4ion/Query
       * @license		http://philsturgeon.co.uk/code/dbad-license
       */

      // --------------------------------------------------------------------------

      namespace Query\Drivers\Pgsql;

      /**
       * Posgres-specific backup, import and creation methods
       *
       * @package Query
       * @subpackage Drivers
       */
      class Util extends \Query\AbstractUtil {

      	/**
      	 * Create an SQL backup file for the current database's structure
      	 *
      	 * @return string
      	 */
      	public function backup_structure()
      	{
      		// TODO Implement Backup function
      		return '';
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Create an SQL backup file for the current database's data
      	 *
      	 * @param array $exclude
      	 * @return string
      	 */
      	public function backup_data($exclude=array())
      	{
      		$tables = $this->get_driver()->get_tables();

      		// Filter out the tables you don't want
      		if( ! empty($exclude))
      		{
      			$tables = array_diff($tables, $exclude);
      		}

      		$output_sql = '';

      		// Get the data for each object
      		foreach($tables as $t)
      		{
      			$sql = 'SELECT * FROM "'.trim($t).'"';
      			$res = $this->get_driver()->query($sql);
      			$obj_res = $res->fetchAll(\PDO::FETCH_ASSOC);

      			// Don't add to the file if the table is empty
      			if (count($obj_res) < 1) continue;

      			$res = NULL;

      			// Nab the column names by getting the keys of the first row
      			$columns = @array_keys($obj_res[0]);

      			$insert_rows = array();

      			// Create the insert statements
      			foreach($obj_res as $row)
      			{
      				$row = array_values($row);

      				// Quote values as needed by type
      				$row = array_map(array($this->get_driver(), 'quote'), $row);
      				$row = array_map('trim', $row);


      				$row_string = 'INSERT INTO "'.trim($t).'" ("'.implode('","', $columns).'") VALUES ('.implode(',', $row).');';

      				$row = NULL;

      				$insert_rows[] = $row_string;
      			}

      			$obj_res = NULL;

      			$output_sql .= "\n\n".implode("\n", $insert_rows)."\n";
      		}

      		return $output_sql;
      	}
      }
      // End of pgsql_util.php

      Generated using phpDox 0.8.2-dev - Copyright (C) 2010 - 2015 by Arne Blankerts
      diff --git a/docs/source/Query/Drivers/Sqlite/Driver.php.html b/docs/source/Query/Drivers/Sqlite/Driver.php.html index 2b5468a..ed5831f 100644 --- a/docs/source/Query/Drivers/Sqlite/Driver.php.html +++ b/docs/source/Query/Drivers/Sqlite/Driver.php.html @@ -1,3 +1,3 @@ phpDox - Source of Driver.php

      Source of file Driver.php

      - Size: 3,390 Bytes - Last Modified: 2015-07-30T16:24:56-04:00

      ../src/Query/Drivers/Sqlite/Driver.php

      123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
      <?php
      /**
       * Query
       *
       * Free Query Builder / Database Abstraction Layer
       *
       * @package		Query
       * @author		Timothy J. Warren
       * @copyright	Copyright (c) 2012 - 2014
       * @link 		https://github.com/aviat4ion/Query
       * @license		http://philsturgeon.co.uk/code/dbad-license
       */

      // --------------------------------------------------------------------------

      namespace Query\Drivers\Sqlite;

      /**
       * SQLite specific class
       *
       * @package Query
       * @subpackage Drivers
       */
      class Driver extends \Query\Abstract_Driver {

      	/**
      	 * Reference to the last executed sql query
      	 *
      	 * @var PDOStatement
      	 */
      	protected $statement;

      	/**
      	 * SQLite has a truncate optimization,
      	 * but no support for the actual keyword
      	 * @var bool
      	 */
      	protected $has_truncate = FALSE;

      	/**
      	 * Open SQLite Database
      	 *
      	 * @param string $dsn
      	 * @param string $user
      	 * @param string $pass
      	 * @param array $driver_options
      	 */
      	public function __construct($dsn, $user=NULL, $pass=NULL, array $driver_options=array())
      	{
      		if (strpos($dsn, 'sqlite:') === FALSE) $dsn = "sqlite:{$dsn}";

      		parent::__construct($dsn, $user, $pass);
      	}


      	// --------------------------------------------------------------------------

      	/**
      	 * List tables for the current database
      	 *
      	 * @return mixed
      	 */
      	public function get_tables()
      	{
      		$sql = $this->sql->table_list();
      		$res = $this->query($sql);
      		return db_filter($res->fetchAll(\PDO::FETCH_ASSOC), 'name');
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Retrieve foreign keys for the table
      	 *
      	 * @param string $table
      	 * @return array
      	 */
      	public function get_fks($table)
      	{
      		$return_rows = array();

      		foreach(parent::get_fks($table) as $row)
      		{
      			$return_rows[] = array(
      				'child_column' => $row['from'],
      				'parent_table' => $row['table'],
      				'parent_column' => $row['to'],
      				'update' => $row['on_update'],
      				'delete' => $row['on_delete']
      			);
      		}

      		return $return_rows;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Create sql for batch insert
      	 *
      	 * @codeCoverageIgnore
      	 * @param string $table
      	 * @param array $data
      	 * @return string
      	 */
      	public function insert_batch($table, $data=array())
      	{
      		// If greater than version 3.7.11, supports the same syntax as
      		// MySQL and Postgres
      		if (version_compare($this->getAttribute(\PDO::ATTR_SERVER_VERSION), '3.7.11', '>='))
      		{
      			return parent::insert_batch($table, $data);
      		}

      		// --------------------------------------------------------------------------
      		// Otherwise, do a union query as an analogue to a 'proper' batch insert
      		// --------------------------------------------------------------------------

      		// Each member of the data array needs to be an array
      		if ( ! is_array(current($data))) return NULL;

      		// Start the block of sql statements
      		$table = $this->quote_table($table);
      		$sql = "INSERT INTO {$table} \n";

      		// Create a key-value mapping for each field
      		$first = array_shift($data);
      		$cols = array();
      		foreach($first as $colname => $datum)
      		{
      			$cols[] = $this->_quote($datum) . ' AS ' . $this->quote_ident($colname);
      		}
      		$sql .= "SELECT " . implode(', ', $cols) . "\n";

      		foreach($data as $union)
      		{
      			$vals = array_map(array($this, 'quote'), $union);
      			$sql .= "UNION SELECT " . implode(',', $vals) . "\n";
      		}

      		return array($sql, NULL);
      	}
      }
      //End of sqlite_driver.php
      Generated using phpDox 0.8.2-dev - Copyright (C) 2010 - 2015 by Arne Blankerts
      + Size: 3,389 Bytes - Last Modified: 2015-11-10T09:58:10-05:00

      ../src/Query/Drivers/Sqlite/Driver.php

      123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
      <?php
      /**
       * Query
       *
       * Free Query Builder / Database Abstraction Layer
       *
       * @package		Query
       * @author		Timothy J. Warren
       * @copyright	Copyright (c) 2012 - 2014
       * @link 		https://github.com/aviat4ion/Query
       * @license		http://philsturgeon.co.uk/code/dbad-license
       */

      // --------------------------------------------------------------------------

      namespace Query\Drivers\Sqlite;

      /**
       * SQLite specific class
       *
       * @package Query
       * @subpackage Drivers
       */
      class Driver extends \Query\AbstractDriver {

      	/**
      	 * Reference to the last executed sql query
      	 *
      	 * @var PDOStatement
      	 */
      	protected $statement;

      	/**
      	 * SQLite has a truncate optimization,
      	 * but no support for the actual keyword
      	 * @var bool
      	 */
      	protected $has_truncate = FALSE;

      	/**
      	 * Open SQLite Database
      	 *
      	 * @param string $dsn
      	 * @param string $user
      	 * @param string $pass
      	 * @param array $driver_options
      	 */
      	public function __construct($dsn, $user=NULL, $pass=NULL, array $driver_options=array())
      	{
      		if (strpos($dsn, 'sqlite:') === FALSE) $dsn = "sqlite:{$dsn}";

      		parent::__construct($dsn, $user, $pass);
      	}


      	// --------------------------------------------------------------------------

      	/**
      	 * List tables for the current database
      	 *
      	 * @return mixed
      	 */
      	public function get_tables()
      	{
      		$sql = $this->sql->table_list();
      		$res = $this->query($sql);
      		return db_filter($res->fetchAll(\PDO::FETCH_ASSOC), 'name');
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Retrieve foreign keys for the table
      	 *
      	 * @param string $table
      	 * @return array
      	 */
      	public function get_fks($table)
      	{
      		$return_rows = array();

      		foreach(parent::get_fks($table) as $row)
      		{
      			$return_rows[] = array(
      				'child_column' => $row['from'],
      				'parent_table' => $row['table'],
      				'parent_column' => $row['to'],
      				'update' => $row['on_update'],
      				'delete' => $row['on_delete']
      			);
      		}

      		return $return_rows;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Create sql for batch insert
      	 *
      	 * @codeCoverageIgnore
      	 * @param string $table
      	 * @param array $data
      	 * @return string
      	 */
      	public function insert_batch($table, $data=array())
      	{
      		// If greater than version 3.7.11, supports the same syntax as
      		// MySQL and Postgres
      		if (version_compare($this->getAttribute(\PDO::ATTR_SERVER_VERSION), '3.7.11', '>='))
      		{
      			return parent::insert_batch($table, $data);
      		}

      		// --------------------------------------------------------------------------
      		// Otherwise, do a union query as an analogue to a 'proper' batch insert
      		// --------------------------------------------------------------------------

      		// Each member of the data array needs to be an array
      		if ( ! is_array(current($data))) return NULL;

      		// Start the block of sql statements
      		$table = $this->quote_table($table);
      		$sql = "INSERT INTO {$table} \n";

      		// Create a key-value mapping for each field
      		$first = array_shift($data);
      		$cols = array();
      		foreach($first as $colname => $datum)
      		{
      			$cols[] = $this->_quote($datum) . ' AS ' . $this->quote_ident($colname);
      		}
      		$sql .= "SELECT " . implode(', ', $cols) . "\n";

      		foreach($data as $union)
      		{
      			$vals = array_map(array($this, 'quote'), $union);
      			$sql .= "UNION SELECT " . implode(',', $vals) . "\n";
      		}

      		return array($sql, NULL);
      	}
      }
      //End of sqlite_driver.php
      Generated using phpDox 0.8.2-dev - Copyright (C) 2010 - 2015 by Arne Blankerts
      diff --git a/docs/source/Query/Drivers/Sqlite/SQL.php.html b/docs/source/Query/Drivers/Sqlite/SQL.php.html index 20e21ea..35735c1 100644 --- a/docs/source/Query/Drivers/Sqlite/SQL.php.html +++ b/docs/source/Query/Drivers/Sqlite/SQL.php.html @@ -1,3 +1,3 @@ phpDox - Source of SQL.php

      Source of file SQL.php

      - Size: 3,919 Bytes - Last Modified: 2015-07-16T15:31:56-04:00

      ../src/Query/Drivers/Sqlite/SQL.php

      123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
      <?php
      /**
       * Query
       *
       * Free Query Builder / Database Abstraction Layer
       *
       * @package		Query
       * @author		Timothy J. Warren
       * @copyright	Copyright (c) 2012 - 2014
       * @link 		https://github.com/aviat4ion/Query
       * @license		http://philsturgeon.co.uk/code/dbad-license
       */

      // --------------------------------------------------------------------------

      namespace Query\Drivers\Sqlite;

      /**
       * SQLite Specific SQL
       *
       * @package Query
       * @subpackage Drivers
       */
      class SQL extends \Query\Abstract_SQL {

      	/**
      	 * Get the query plan for the sql query
      	 *
      	 * @param string $sql
      	 * @return string
      	 */
      	public function explain($sql)
      	{
      		return "EXPLAIN QUERY PLAN {$sql}";
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Random ordering keyword
      	 *
      	 * @return string
      	 */
      	public function random()
      	{
      		return ' RANDOM()';
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Returns sql to list other databases
      	 *
      	 * @return string
      	 */
      	public function db_list()
      	{
      		return 'PRAGMA database_list';
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Returns sql to list tables
      	 *
      	 * @return string
      	 */
      	public function table_list()
      	{
      		return <<<SQL
      			SELECT DISTINCT "name"
      			FROM "sqlite_master"
      			WHERE "type"='table'
      			AND "name" NOT LIKE 'sqlite_%'
      			ORDER BY "name" DESC
      SQL;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * List the system tables
      	 *
      	 * @return string[]
      	 */
      	public function system_table_list()
      	{
      		return array('sqlite_master', 'sqlite_temp_master', 'sqlite_sequence');
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Returns sql to list views
      	 *
      	 * @return string
      	 */
      	public function view_list()
      	{
      		return <<<SQL
      			SELECT "name" FROM "sqlite_master" WHERE "type" = 'view'
      SQL;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Returns sql to list triggers
      	 *
      	 * @return string
      	 */
      	public function trigger_list()
      	{
      		return 'SELECT "name" FROM "sqlite_master" WHERE "type"=\'trigger\'';
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Return sql to list functions
      	 *
      	 * @return NULL
      	 */
      	public function function_list()
      	{
      		return NULL;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Return sql to list stored procedures
      	 *
      	 * @return NULL
      	 */
      	public function procedure_list()
      	{
      		return NULL;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Return sql to list sequences
      	 *
      	 * @return NULL
      	 */
      	public function sequence_list()
      	{
      		return NULL;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * SQL to show list of field types
      	 *
      	 * @return string[]
      	 */
      	public function type_list()
      	{
      		return array('INTEGER', 'REAL', 'TEXT', 'BLOB');
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * SQL to show infromation about columns in a table
      	 *
      	 * @param string $table
      	 * @return string
      	 */
      	public function column_list($table)
      	{
      		return 'PRAGMA table_info("'.$table.'")';
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Get the list of foreign keys for the current
      	 * table
      	 *
      	 * @param string $table
      	 * @return string
      	 */
      	public function fk_list($table)
      	{
      		return 'PRAGMA foreign_key_list("' . $table . '")';
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Get the list of indexes for the current table
      	 *
      	 * @param string $table
      	 * @return string
      	 */
      	public function index_list($table)
      	{
      		return 'PRAGMA index_list("' . $table . '")';
      	}

      }
      //End of sqlite_sql.php
      Generated using phpDox 0.8.2-dev - Copyright (C) 2010 - 2015 by Arne Blankerts
      + Size: 3,918 Bytes - Last Modified: 2015-11-10T10:05:21-05:00

      ../src/Query/Drivers/Sqlite/SQL.php

      123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
      <?php
      /**
       * Query
       *
       * Free Query Builder / Database Abstraction Layer
       *
       * @package		Query
       * @author		Timothy J. Warren
       * @copyright	Copyright (c) 2012 - 2014
       * @link 		https://github.com/aviat4ion/Query
       * @license		http://philsturgeon.co.uk/code/dbad-license
       */

      // --------------------------------------------------------------------------

      namespace Query\Drivers\Sqlite;

      /**
       * SQLite Specific SQL
       *
       * @package Query
       * @subpackage Drivers
       */
      class SQL extends \Query\AbstractSQL {

      	/**
      	 * Get the query plan for the sql query
      	 *
      	 * @param string $sql
      	 * @return string
      	 */
      	public function explain($sql)
      	{
      		return "EXPLAIN QUERY PLAN {$sql}";
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Random ordering keyword
      	 *
      	 * @return string
      	 */
      	public function random()
      	{
      		return ' RANDOM()';
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Returns sql to list other databases
      	 *
      	 * @return string
      	 */
      	public function db_list()
      	{
      		return 'PRAGMA database_list';
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Returns sql to list tables
      	 *
      	 * @return string
      	 */
      	public function table_list()
      	{
      		return <<<SQL
      			SELECT DISTINCT "name"
      			FROM "sqlite_master"
      			WHERE "type"='table'
      			AND "name" NOT LIKE 'sqlite_%'
      			ORDER BY "name" DESC
      SQL;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * List the system tables
      	 *
      	 * @return string[]
      	 */
      	public function system_table_list()
      	{
      		return array('sqlite_master', 'sqlite_temp_master', 'sqlite_sequence');
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Returns sql to list views
      	 *
      	 * @return string
      	 */
      	public function view_list()
      	{
      		return <<<SQL
      			SELECT "name" FROM "sqlite_master" WHERE "type" = 'view'
      SQL;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Returns sql to list triggers
      	 *
      	 * @return string
      	 */
      	public function trigger_list()
      	{
      		return 'SELECT "name" FROM "sqlite_master" WHERE "type"=\'trigger\'';
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Return sql to list functions
      	 *
      	 * @return NULL
      	 */
      	public function function_list()
      	{
      		return NULL;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Return sql to list stored procedures
      	 *
      	 * @return NULL
      	 */
      	public function procedure_list()
      	{
      		return NULL;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Return sql to list sequences
      	 *
      	 * @return NULL
      	 */
      	public function sequence_list()
      	{
      		return NULL;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * SQL to show list of field types
      	 *
      	 * @return string[]
      	 */
      	public function type_list()
      	{
      		return array('INTEGER', 'REAL', 'TEXT', 'BLOB');
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * SQL to show infromation about columns in a table
      	 *
      	 * @param string $table
      	 * @return string
      	 */
      	public function column_list($table)
      	{
      		return 'PRAGMA table_info("'.$table.'")';
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Get the list of foreign keys for the current
      	 * table
      	 *
      	 * @param string $table
      	 * @return string
      	 */
      	public function fk_list($table)
      	{
      		return 'PRAGMA foreign_key_list("' . $table . '")';
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Get the list of indexes for the current table
      	 *
      	 * @param string $table
      	 * @return string
      	 */
      	public function index_list($table)
      	{
      		return 'PRAGMA index_list("' . $table . '")';
      	}

      }
      //End of sqlite_sql.php
      Generated using phpDox 0.8.2-dev - Copyright (C) 2010 - 2015 by Arne Blankerts
      diff --git a/docs/source/Query/Drivers/Sqlite/Util.php.html b/docs/source/Query/Drivers/Sqlite/Util.php.html index ac0aa0b..60d6044 100644 --- a/docs/source/Query/Drivers/Sqlite/Util.php.html +++ b/docs/source/Query/Drivers/Sqlite/Util.php.html @@ -1,3 +1,3 @@ phpDox - Source of Util.php

      Source of file Util.php

      - Size: 2,750 Bytes - Last Modified: 2015-07-16T15:32:43-04:00

      ../src/Query/Drivers/Sqlite/Util.php

      123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
      <?php
      /**
       * Query
       *
       * Free Query Builder / Database Abstraction Layer
       *
       * @package		Query
       * @author		Timothy J. Warren
       * @copyright	Copyright (c) 2012 - 2014
       * @link 		https://github.com/aviat4ion/Query
       * @license		http://philsturgeon.co.uk/code/dbad-license
       */

      // --------------------------------------------------------------------------

      namespace Query\Drivers\Sqlite;

      /**
       * SQLite-specific backup, import and creation methods
       *
       * @package Query
       * @subpackage Drivers
       * @method mixed query(string $sql)
       * @method string quote(string $str)
       */
      class Util extends \Query\Abstract_Util {

      	/**
      	 * Create an SQL backup file for the current database's data
      	 *
      	 * @param array $excluded
      	 * @return string
      	 */
      	public function backup_data($excluded=array())
      	{
      		// Get a list of all the objects
      		$sql = 'SELECT DISTINCT "name"
      				FROM "sqlite_master"
      				WHERE "type"=\'table\'';

      		if( ! empty($excluded))
      		{
      			$sql .= " AND \"name\" NOT IN('".implode("','", $excluded)."')";
      		}

      		$res = $this->get_driver()->query($sql);
      		$result = $res->fetchAll(\PDO::FETCH_ASSOC);

      		unset($res);

      		$output_sql = '';

      		// Get the data for each object
      		foreach($result as $r)
      		{
      			$sql = 'SELECT * FROM "'.$r['name'].'"';
      			$res = $this->get_driver()->query($sql);
      			$obj_res = $res->fetchAll(\PDO::FETCH_ASSOC);

      			unset($res);

      			// If the row is empty, continue;
      			if (empty($obj_res)) continue;

      			// Nab the column names by getting the keys of the first row
      			$columns = array_keys(current($obj_res));

      			$insert_rows = array();

      			// Create the insert statements
      			foreach($obj_res as $row)
      			{
      				$row = array_values($row);

      				// Quote values as needed by type
      				for($i=0, $icount=count($row); $i<$icount; $i++)
      				{
      					$row[$i] = (is_numeric($row[$i])) ? $row[$i] : $this->get_driver()->quote($row[$i]);
      				}

      				$row_string = 'INSERT INTO "'.$r['name'].'" ("'.implode('","', $columns).'") VALUES ('.implode(',', $row).');';

      				unset($row);

      				$insert_rows[] = $row_string;
      			}

      			unset($obj_res);

      			$output_sql .= "\n\n".implode("\n", $insert_rows);
      		}

      		return $output_sql;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Create an SQL backup file for the current database's structure
      	 *
      	 * @return string
      	 */
      	public function backup_structure()
      	{
      		// Fairly easy for SQLite...just query the master table
      		$sql = 'SELECT "sql" FROM "sqlite_master"';
      		$res = $this->get_driver()->query($sql);
      		$result = $res->fetchAll(\PDO::FETCH_ASSOC);

      		$sql_array = array();

      		foreach($result as $r)
      		{
      			$sql_array[] = $r['sql'];
      		}

      		$sql_structure = implode(";\n", $sql_array) . ";";

      		return $sql_structure;
      	}
      }
      // End of sqlite_util.php
      Generated using phpDox 0.8.2-dev - Copyright (C) 2010 - 2015 by Arne Blankerts
      + Size: 2,749 Bytes - Last Modified: 2015-11-10T10:05:25-05:00

      ../src/Query/Drivers/Sqlite/Util.php

      123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
      <?php
      /**
       * Query
       *
       * Free Query Builder / Database Abstraction Layer
       *
       * @package		Query
       * @author		Timothy J. Warren
       * @copyright	Copyright (c) 2012 - 2014
       * @link 		https://github.com/aviat4ion/Query
       * @license		http://philsturgeon.co.uk/code/dbad-license
       */

      // --------------------------------------------------------------------------

      namespace Query\Drivers\Sqlite;

      /**
       * SQLite-specific backup, import and creation methods
       *
       * @package Query
       * @subpackage Drivers
       * @method mixed query(string $sql)
       * @method string quote(string $str)
       */
      class Util extends \Query\AbstractUtil {

      	/**
      	 * Create an SQL backup file for the current database's data
      	 *
      	 * @param array $excluded
      	 * @return string
      	 */
      	public function backup_data($excluded=array())
      	{
      		// Get a list of all the objects
      		$sql = 'SELECT DISTINCT "name"
      				FROM "sqlite_master"
      				WHERE "type"=\'table\'';

      		if( ! empty($excluded))
      		{
      			$sql .= " AND \"name\" NOT IN('".implode("','", $excluded)."')";
      		}

      		$res = $this->get_driver()->query($sql);
      		$result = $res->fetchAll(\PDO::FETCH_ASSOC);

      		unset($res);

      		$output_sql = '';

      		// Get the data for each object
      		foreach($result as $r)
      		{
      			$sql = 'SELECT * FROM "'.$r['name'].'"';
      			$res = $this->get_driver()->query($sql);
      			$obj_res = $res->fetchAll(\PDO::FETCH_ASSOC);

      			unset($res);

      			// If the row is empty, continue;
      			if (empty($obj_res)) continue;

      			// Nab the column names by getting the keys of the first row
      			$columns = array_keys(current($obj_res));

      			$insert_rows = array();

      			// Create the insert statements
      			foreach($obj_res as $row)
      			{
      				$row = array_values($row);

      				// Quote values as needed by type
      				for($i=0, $icount=count($row); $i<$icount; $i++)
      				{
      					$row[$i] = (is_numeric($row[$i])) ? $row[$i] : $this->get_driver()->quote($row[$i]);
      				}

      				$row_string = 'INSERT INTO "'.$r['name'].'" ("'.implode('","', $columns).'") VALUES ('.implode(',', $row).');';

      				unset($row);

      				$insert_rows[] = $row_string;
      			}

      			unset($obj_res);

      			$output_sql .= "\n\n".implode("\n", $insert_rows);
      		}

      		return $output_sql;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Create an SQL backup file for the current database's structure
      	 *
      	 * @return string
      	 */
      	public function backup_structure()
      	{
      		// Fairly easy for SQLite...just query the master table
      		$sql = 'SELECT "sql" FROM "sqlite_master"';
      		$res = $this->get_driver()->query($sql);
      		$result = $res->fetchAll(\PDO::FETCH_ASSOC);

      		$sql_array = array();

      		foreach($result as $r)
      		{
      			$sql_array[] = $r['sql'];
      		}

      		$sql_structure = implode(";\n", $sql_array) . ";";

      		return $sql_structure;
      	}
      }
      // End of sqlite_util.php
      Generated using phpDox 0.8.2-dev - Copyright (C) 2010 - 2015 by Arne Blankerts
      diff --git a/docs/source/Query/QueryBuilder.php.html b/docs/source/Query/QueryBuilder.php.html new file mode 100644 index 0000000..a504f78 --- /dev/null +++ b/docs/source/Query/QueryBuilder.php.html @@ -0,0 +1,3 @@ + +phpDox - Source of QueryBuilder.php

      Source of file QueryBuilder.php

      + Size: 21,093 Bytes - Last Modified: 2015-11-10T09:58:56-05:00

      ../src/Query/QueryBuilder.php

      123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901
      <?php
      /**
       * Query
       *
       * Free Query Builder / Database Abstraction Layer
       *
       * @package		Query
       * @author		Timothy J. Warren
       * @copyright	Copyright (c) 2012 - 2014
       * @link 		https://github.com/aviat4ion/Query
       * @license		http://philsturgeon.co.uk/code/dbad-license
       */

      // --------------------------------------------------------------------------

      namespace Query;

      // --------------------------------------------------------------------------

      /**
       * Convenience class for creating sql queries - also the class that
       * instantiates the specific db driver
       *
       * @package Query
       * @subpackage Query_Builder
       */
      class QueryBuilder extends AbstractQueryBuilder implements QueryBuilderInterface {

      	/**
      	 * 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
      	// --------------------------------------------------------------------------

      	/**
      	 * Constructor
      	 *
      	 * @param Driver_Interface $db
      	 * @param Query_Parser $parser
      	 */
      	public function __construct(Driver_Interface $db, Query_Parser $parser)
      	{
      		// Inject driver and parser
      		$this->db = $db;
      		$this->parser = $parser;

      		$this->queries['total_time'] = 0;

      		// Alias driver sql and util classes
      		$this->sql = $this->db->get_sql();
      		$this->util = $this->db->get_util();
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Destructor
      	 * @codeCoverageIgnore
      	 */
      	public function __destruct()
      	{
      		$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
      	// --------------------------------------------------------------------------

      	/**
      	 * Specifies rows to select in a query
      	 *
      	 * @param string $fields
      	 * @return Query_Builder
      	 */
      	public function select($fields)
      	{
      		// Split fields by comma
      		$fields_array = explode(",", $fields);
      		$fields_array = array_map('mb_trim', $fields_array);

      		// Split on 'As'
      		foreach ($fields_array as $key => $field)
      		{
      			if (stripos($field, 'as') !== FALSE)
      			{
      				$fields_array[$key] = preg_split('` as `i', $field);
      				$fields_array[$key] = array_map('mb_trim', $fields_array[$key]);
      			}
      		}

      		// Quote the identifiers
      		$safe_array = $this->db->quote_ident($fields_array);

      		unset($fields_array);

      		// Join the strings back together
      		for($i = 0, $c = count($safe_array); $i < $c; $i++)
      		{
      			if (is_array($safe_array[$i]))
      			{
      				$safe_array[$i] = implode(' AS ', $safe_array[$i]);
      			}
      		}

      		$this->select_string .= implode(', ', $safe_array);

      		unset($safe_array);

      		return $this;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Selects the maximum value of a field from a query
      	 *
      	 * @param string $field
      	 * @param string|FALSE $as
      	 * @return Query_Builder
      	 */
      	public function select_max($field, $as=FALSE)
      	{
      		// Create the select string
      		$this->select_string .= ' MAX'.$this->_select($field, $as);
      		return $this;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Selects the minimum value of a field from a query
      	 *
      	 * @param string $field
      	 * @param string|bool $as
      	 * @return Query_Builder
      	 */
      	public function select_min($field, $as=FALSE)
      	{
      		// Create the select string
      		$this->select_string .= ' MIN'.$this->_select($field, $as);
      		return $this;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Selects the average value of a field from a query
      	 *
      	 * @param string $field
      	 * @param string|bool $as
      	 * @return Query_Builder
      	 */
      	public function select_avg($field, $as=FALSE)
      	{
      		// Create the select string
      		$this->select_string .= ' AVG'.$this->_select($field, $as);
      		return $this;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Selects the sum of a field from a query
      	 *
      	 * @param string $field
      	 * @param string|bool $as
      	 * @return Query_Builder
      	 */
      	public function select_sum($field, $as=FALSE)
      	{
      		// Create the select string
      		$this->select_string .= ' SUM'.$this->_select($field, $as);
      		return $this;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Adds the 'distinct' keyword to a query
      	 *
      	 * @return Query_Builder
      	 */
      	public function distinct()
      	{
      		// Prepend the keyword to the select string
      		$this->select_string = ' DISTINCT '.$this->select_string;
      		return $this;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Tell the database to give you the query plan instead of result set
      	 *
      	 * @return Query_Builder
      	 */
      	public function explain()
      	{
      		$this->explain = TRUE;
      		return $this;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Specify the database table to select from
      	 *
      	 * @param string $tblname
      	 * @return Query_Builder
      	 */
      	public function from($tblname)
      	{
      		// Split identifiers on spaces
      		$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]);
      		$ident_array = $this->db->quote_ident($ident_array);

      		// Paste it back together
      		$this->from_string = implode(' ', $ident_array);

      		return $this;
      	}

      	// --------------------------------------------------------------------------
      	// ! 'Like' methods
      	// --------------------------------------------------------------------------

      	/**
      	 * Creates a Like clause in the sql statement
      	 *
      	 * @param string $field
      	 * @param mixed $val
      	 * @param string $pos
      	 * @return Query_Builder
      	 */
      	public function like($field, $val, $pos='both')
      	{
      		return $this->_like($field, $val, $pos, 'LIKE', 'AND');
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Generates an OR Like clause
      	 *
      	 * @param string $field
      	 * @param mixed $val
      	 * @param string $pos
      	 * @return Query_Builder
      	 */
      	public function or_like($field, $val, $pos='both')
      	{
      		return $this->_like($field, $val, $pos, 'LIKE', 'OR');
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Generates a NOT LIKE clause
      	 *
      	 * @param string $field
      	 * @param mixed $val
      	 * @param string $pos
      	 * @return Query_Builder
      	 */
      	public function not_like($field, $val, $pos='both')
      	{
      		return $this->_like($field, $val, $pos, 'NOT LIKE', 'AND');
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Generates a OR NOT LIKE clause
      	 *
      	 * @param string $field
      	 * @param mixed $val
      	 * @param string $pos
      	 * @return Query_Builder
      	 */
      	public function or_not_like($field, $val, $pos='both')
      	{
      		return $this->_like($field, $val, $pos, 'NOT LIKE', 'OR');
      	}

      	// --------------------------------------------------------------------------
      	// ! Having methods
      	// --------------------------------------------------------------------------

      	/**
      	 * Generates a 'Having' clause
      	 *
      	 * @param mixed $key
      	 * @param mixed $val
      	 * @return Query_Builder
      	 */
      	public function having($key, $val=array())
      	{
      		return $this->_having($key, $val, 'AND');
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Generates a 'Having' clause prefixed with 'OR'
      	 *
      	 * @param mixed $key
      	 * @param mixed $val
      	 * @return Query_Builder
      	 */
      	public function or_having($key, $val=array())
      	{
      		return $this->_having($key, $val, 'OR');
      	}

      	// --------------------------------------------------------------------------
      	// ! 'Where' methods
      	// --------------------------------------------------------------------------

      	/**
      	 * Specify condition(s) in the where clause of a query
      	 * Note: this function works with key / value, or a
      	 * passed array with key / value pairs
      	 *
      	 * @param mixed $key
      	 * @param mixed $val
      	 * @param mixed $escape
      	 * @return Query_Builder
      	 */
      	public function where($key, $val=array(), $escape=NULL)
      	{
      		return $this->_where_string($key, $val, 'AND');
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Where clause prefixed with "OR"
      	 *
      	 * @param string $key
      	 * @param mixed $val
      	 * @return Query_Builder
      	 */
      	public function or_where($key, $val=array())
      	{
      		return $this->_where_string($key, $val, 'OR');
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Where clause with 'IN' statement
      	 *
      	 * @param mixed $field
      	 * @param mixed $val
      	 * @return Query_Builder
      	 */
      	public function where_in($field, $val=array())
      	{
      		return $this->_where_in($field, $val);
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Where in statement prefixed with "or"
      	 *
      	 * @param string $field
      	 * @param mixed $val
      	 * @return Query_Builder
      	 */
      	public function or_where_in($field, $val=array())
      	{
      		return $this->_where_in($field, $val, 'IN', 'OR');
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * WHERE NOT IN (FOO) clause
      	 *
      	 * @param string $field
      	 * @param mixed $val
      	 * @return Query_Builder
      	 */
      	public function where_not_in($field, $val=array())
      	{
      		return $this->_where_in($field, $val, 'NOT IN', 'AND');
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * OR WHERE NOT IN (FOO) clause
      	 *
      	 * @param string $field
      	 * @param mixed $val
      	 * @return Query_Builder
      	 */
      	public function or_where_not_in($field, $val=array())
      	{
      		return $this->_where_in($field, $val, 'NOT IN', 'OR');
      	}

      	// --------------------------------------------------------------------------
      	// ! Other Query Modifier methods
      	// --------------------------------------------------------------------------

      	/**
      	 * Sets values for inserts / updates / deletes
      	 *
      	 * @param mixed $key
      	 * @param mixed $val
      	 * @return Query_Builder
      	 */
      	public function set($key, $val = NULL)
      	{
      		$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
      		$this->set_array_keys = array_map(array($this->db, '_quote'), $this->set_array_keys);

      		// Generate the "set" string
      		$this->set_string = implode('=?,', $this->set_array_keys);
      		$this->set_string .= '=?';

      		return $this;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Creates a join phrase in a compiled query
      	 *
      	 * @param string $table
      	 * @param string $condition
      	 * @param string $type
      	 * @return Query_Builder
      	 */
      	public function join($table, $condition, $type='')
      	{
      		// Prefix and quote table name
      		$table = explode(' ', mb_trim($table));
      		$table[0] = $this->db->quote_table($table[0]);
      		$table = $this->db->quote_ident($table);
      		$table = implode(' ', $table);

      		// Parse out the join condition
      		$parsed_condition = $this->parser->compile_join($condition);
      		$condition = $table . ' ON ' . $parsed_condition;

      		$this->_append_map("\n" . strtoupper($type) . ' JOIN ', $condition, 'join');

      		return $this;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Group the results by the selected field(s)
      	 *
      	 * @param mixed $field
      	 * @return Query_Builder
      	 */
      	public function group_by($field)
      	{
      		if ( ! is_scalar($field))
      		{
      			$new_group_array = array_map(array($this->db, 'quote_ident'), $field);
      			$this->group_array = array_merge($this->group_array, $new_group_array);
      		}
      		else
      		{
      			$this->group_array[] = $this->db->quote_ident($field);
      		}

      		$this->group_string = ' GROUP BY ' . implode(',', $this->group_array);

      		return $this;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Order the results by the selected field(s)
      	 *
      	 * @param string $field
      	 * @param string $type
      	 * @return Query_Builder
      	 */
      	public function order_by($field, $type="")
      	{
      		// When ordering by random, do an ascending order if the driver
      		// doesn't support random ordering
      		if (stripos($type, 'rand') !== FALSE)
      		{
      			$rand = $this->sql->random();
      			$type = ($rand !== FALSE) ? $rand : 'ASC';
      		}

      		// Set fields for later manipulation
      		$field = $this->db->quote_ident($field);
      		$this->order_array[$field] = $type;

      		$order_clauses = array();

      		// Flatten key/val pairs into an array of space-separated pairs
      		foreach($this->order_array as $k => $v)
      		{
      			$order_clauses[] = $k . ' ' . strtoupper($v);
      		}

      		// Set the final string
      		$this->order_string = ( ! isset($rand))
      			? "\nORDER BY ".implode(', ', $order_clauses)
      			: "\nORDER BY".$rand;

      		return $this;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Set a limit on the current sql statement
      	 *
      	 * @param int $limit
      	 * @param int|bool $offset
      	 * @return Query_Builder
      	 */
      	public function limit($limit, $offset=FALSE)
      	{
      		$this->limit = (int) $limit;
      		$this->offset = $offset;

      		return $this;
      	}

      	// --------------------------------------------------------------------------
      	// ! Query Grouping Methods
      	// --------------------------------------------------------------------------

      	/**
      	 * Adds a paren to the current query for query grouping
      	 *
      	 * @return Query_Builder
      	 */
      	public function group_start()
      	{
      		$conj = (empty($this->query_map)) ? ' WHERE ' : ' ';

      		$this->_append_map($conj, '(', 'group_start');

      		return $this;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Adds a paren to the current query for query grouping,
      	 * prefixed with 'OR'
      	 *
      	 * @return Query_Builder
      	 */
      	public function or_group_start()
      	{
      		$this->_append_map('', ' OR (', 'group_start');

      		return $this;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Adds a paren to the current query for query grouping,
      	 * prefixed with 'OR NOT'
      	 *
      	 * @return Query_Builder
      	 */
      	public function or_not_group_start()
      	{
      		$this->_append_map('', ' OR NOT (', 'group_start');

      		return $this;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Ends a query group
      	 *
      	 * @return Query_Builder
      	 */
      	public function group_end()
      	{
      		$this->_append_map('', ')', 'group_end');

      		return $this;
      	}

      	// --------------------------------------------------------------------------
      	// ! Query execution methods
      	// --------------------------------------------------------------------------

      	/**
      	 * Select and retrieve all records from the current table, and/or
      	 * execute current compiled query
      	 *
      	 * @param $table
      	 * @param int|bool $limit
      	 * @param int|bool $offset
      	 * @return \PDOStatement
      	 */
      	public function get($table='', $limit=FALSE, $offset=FALSE)
      	{
      		// Set the table
      		if ( ! empty($table)) $this->from($table);

      		// Set the limit, if it exists
      		if (is_int($limit)) $this->limit($limit, $offset);

      		return $this->_run("get", $table);
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Convenience method for get() with a where clause
      	 *
      	 * @param string $table
      	 * @param array $where
      	 * @param int|bool $limit
      	 * @param int|bool $offset
      	 * @return \PDOStatement
      	 */
      	public function get_where($table, $where=array(), $limit=FALSE, $offset=FALSE)
      	{
      		// Create the where clause
      		$this->where($where);

      		// Return the result
      		return $this->get($table, $limit, $offset);
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Retreive the number of rows in the selected table
      	 *
      	 * @param string $table
      	 * @return int
      	 */
      	public function count_all($table)
      	{
      		$sql = 'SELECT * FROM '.$this->db->quote_table($table);
      		$res = $this->db->query($sql);
      		return (int) count($res->fetchAll());
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Retrieve the number of results for the generated query - used
      	 * in place of the get() method
      	 *
      	 * @param string $table
      	 * @return int
      	 */
      	public function count_all_results($table='')
      	{
      		// Set the table
      		if ( ! empty($table)) $this->from($table);

      		$result = $this->_run('get', $table);
      		$rows = $result->fetchAll();

      		return (int) count($rows);
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Creates an insert clause, and executes it
      	 *
      	 * @param string $table
      	 * @param mixed $data
      	 * @return \PDOStatement
      	 */
      	public function insert($table, $data=array())
      	{
      		// No use duplicating logic!
      		if ( ! empty($data)) $this->set($data);

      		return $this->_run("insert", $table);
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Creates and executes a batch insertion query
      	 *
      	 * @param string $table
      	 * @param array $data
      	 * @return \PDOStatement
      	 */
      	public function insert_batch($table, $data=array())
      	{
      		// Get the generated values and sql string
      		list($sql, $data) = $this->db->insert_batch($table, $data);

      		return ( ! is_null($sql))
      			? $this->_run('', $table, $sql, $data)
      			: NULL;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Creates an update clause, and executes it
      	 *
      	 * @param string $table
      	 * @param mixed $data
      	 * @return \PDOStatement
      	 */
      	public function update($table, $data=array())
      	{
      		// No use duplicating logic!
      		if ( ! empty($data)) $this->set($data);

      		return $this->_run("update", $table);
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Deletes data from a table
      	 *
      	 * @param string $table
      	 * @param mixed $where
      	 * @return \PDOStatement
      	 */
      	public function delete($table, $where='')
      	{
      		// Set the where clause
      		if ( ! empty($where)) $this->where($where);

      		return $this->_run("delete", $table);
      	}

      	// --------------------------------------------------------------------------
      	// ! SQL Returning Methods
      	// --------------------------------------------------------------------------



      	/**
      	 * Returns the generated 'select' sql query
      	 *
      	 * @param string $table
      	 * @param bool $reset
      	 * @return string
      	 */
      	public function get_compiled_select($table='', $reset=TRUE)
      	{
      		// Set the table
      		if ( ! empty($table)) $this->from($table);

      		return $this->_get_compile('select', $table, $reset);
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Returns the generated 'insert' sql query
      	 *
      	 * @param string $table
      	 * @param bool $reset
      	 * @return string
      	 */
      	public function get_compiled_insert($table, $reset=TRUE)
      	{
      		return $this->_get_compile('insert', $table, $reset);
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Returns the generated 'update' sql query
      	 *
      	 * @param string $table
      	 * @param bool $reset
      	 * @return string
      	 */
      	public function get_compiled_update($table='', $reset=TRUE)
      	{
      		return $this->_get_compile('update', $table, $reset);
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Returns the generated 'delete' sql query
      	 *
      	 * @param string $table
      	 * @param bool $reset
      	 * @return string
      	 */
      	public function get_compiled_delete($table="", $reset=TRUE)
      	{
      		return $this->_get_compile('delete', $table, $reset);
      	}


      	// --------------------------------------------------------------------------
      	// ! Miscellaneous Methods
      	// --------------------------------------------------------------------------

      	/**
      	 * Clear out the class variables, so the next query can be run
      	 *
      	 * @return void
      	 */
      	public function reset_query()
      	{
      		// Reset strings and booleans
      		foreach($this->string_vars as $var)
      		{
      			$this->$var = NULL;
      		}

      		// Reset arrays
      		foreach($this->array_vars as $var)
      		{
      			$this->$var = array();
      		}
      	}
      }
      // End of query_builder.php
      Generated using phpDox 0.8.2-dev - Copyright (C) 2010 - 2015 by Arne Blankerts
      diff --git a/docs/source/Query/QueryBuilderInterface.php.html b/docs/source/Query/QueryBuilderInterface.php.html new file mode 100644 index 0000000..85285fd --- /dev/null +++ b/docs/source/Query/QueryBuilderInterface.php.html @@ -0,0 +1,3 @@ + +phpDox - Source of QueryBuilderInterface.php

      Source of file QueryBuilderInterface.php

      + Size: 12,435 Bytes - Last Modified: 2015-11-10T09:59:33-05:00

      ../src/Query/QueryBuilderInterface.php

      123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504
      <?php
      /**
       * Query
       *
       * Free Query Builder / Database Abstraction Layer
       *
       * @package		Query
       * @author		Timothy J. Warren
       * @copyright	Copyright (c) 2012 - 2014
       * @link 		https://github.com/aviat4ion/Query
       * @license		http://philsturgeon.co.uk/code/dbad-license
       */

      // --------------------------------------------------------------------------

      namespace Query;

      /**
       * Interface defining the Query Builder class
       *
       * @package Query
       * @subpackage Query_Builder
       */
      interface QueryBuilderInterface {

      	// --------------------------------------------------------------------------
      	// ! Select Queries
      	// --------------------------------------------------------------------------

      	/**
      	 * Specifies rows to select in a query
      	 *
      	 * @param string $fields
      	 * @return Query_Builder
      	 */
      	public function select($fields);

      	// --------------------------------------------------------------------------

      	/**
      	 * Selects the maximum value of a field from a query
      	 *
      	 * @param string $field
      	 * @param string|bool $as
      	 * @return Query_Builder
      	 */
      	public function select_max($field, $as=FALSE);

      	// --------------------------------------------------------------------------

      	/**
      	 * Selects the minimum value of a field from a query
      	 *
      	 * @param string $field
      	 * @param string|bool $as
      	 * @return Query_Builder
      	 */
      	public function select_min($field, $as=FALSE);

      	// --------------------------------------------------------------------------

      	/**
      	 * Selects the average value of a field from a query
      	 *
      	 * @param string $field
      	 * @param string|bool $as
      	 * @return Query_Builder
      	 */
      	public function select_avg($field, $as=FALSE);

      	// --------------------------------------------------------------------------

      	/**
      	 * Selects the sum of a field from a query
      	 *
      	 * @param string $field
      	 * @param string|bool $as
      	 * @return Query_Builder
      	 */
      	public function select_sum($field, $as=FALSE);

      	// --------------------------------------------------------------------------

      	/**
      	 * Adds the 'distinct' keyword to a query
      	 *
      	 * @return Query_Builder
      	 */
      	public function distinct();

      	// --------------------------------------------------------------------------

      	/**
      	 * Shows the query plan for the query
      	 *
      	 * @return Query_Builder
      	 */
      	public function explain();

      	// --------------------------------------------------------------------------

      	/**
      	 * Specify the database table to select from
      	 *
      	 * @param string $tblname
      	 * @return Query_Builder
      	 */
      	public function from($tblname);

      	// --------------------------------------------------------------------------
      	// ! 'Like' methods
      	// --------------------------------------------------------------------------

      	/**
      	 * Creates a Like clause in the sql statement
      	 *
      	 * @param string $field
      	 * @param mixed $val
      	 * @param string $pos
      	 * @return Query_Builder
      	 */
      	public function like($field, $val, $pos='both');

      	// --------------------------------------------------------------------------

      	/**
      	 * Generates an OR Like clause
      	 *
      	 * @param string $field
      	 * @param mixed $val
      	 * @param string $pos
      	 * @return Query_Builder
      	 */
      	public function or_like($field, $val, $pos='both');

      	// --------------------------------------------------------------------------

      	/**
      	 * Generates a NOT LIKE clause
      	 *
      	 * @param string $field
      	 * @param mixed $val
      	 * @param string $pos
      	 * @return Query_Builder
      	 */
      	public function not_like($field, $val, $pos='both');

      	// --------------------------------------------------------------------------

      	/**
      	 * Generates a OR NOT LIKE clause
      	 *
      	 * @param string $field
      	 * @param mixed $val
      	 * @param string $pos
      	 * @return Query_Builder
      	 */
      	public function or_not_like($field, $val, $pos='both');

      	// --------------------------------------------------------------------------
      	// ! Having methods
      	// --------------------------------------------------------------------------

      	/**
      	 * Generates a 'Having' clause
      	 *
      	 * @param mixed $key
      	 * @param mixed $val
      	 * @return Query_Builder
      	 */
      	public function having($key, $val=array());

      	// --------------------------------------------------------------------------

      	/**
      	 * Generates a 'Having' clause prefixed with 'OR'
      	 *
      	 * @param mixed $key
      	 * @param mixed $val
      	 * @return Query_Builder
      	 */
      	public function or_having($key, $val=array());

      	// --------------------------------------------------------------------------
      	// ! 'Where' methods
      	// --------------------------------------------------------------------------

      	/**
      	 * Specify condition(s) in the where clause of a query
      	 * Note: this function works with key / value, or a
      	 * passed array with key / value pairs
      	 *
      	 * @param mixed $key
      	 * @param mixed $val
      	 * @param bool $escape
      	 * @return Query_Builder
      	 */
      	public function where($key, $val=array(), $escape = NULL);

      	// --------------------------------------------------------------------------

      	/**
      	 * Where clause prefixed with "OR"
      	 *
      	 * @param string $key
      	 * @param mixed $val
      	 * @return Query_Builder
      	 */
      	public function or_where($key, $val=array());

      	// --------------------------------------------------------------------------

      	/**
      	 * Where clause with 'IN' statement
      	 *
      	 * @param mixed $field
      	 * @param mixed $val
      	 * @return Query_Builder
      	 */
      	public function where_in($field, $val=array());

      	// --------------------------------------------------------------------------

      	/**
      	 * Where in statement prefixed with "or"
      	 *
      	 * @param string $field
      	 * @param mixed $val
      	 * @return Query_Builder
      	 */
      	public function or_where_in($field, $val=array());

      	// --------------------------------------------------------------------------

      	/**
      	 * WHERE NOT IN (FOO) clause
      	 *
      	 * @param string $field
      	 * @param mixed $val
      	 * @return Query_Builder
      	 */
      	public function where_not_in($field, $val=array());

      	// --------------------------------------------------------------------------

      	/**
      	 * OR WHERE NOT IN (FOO) clause
      	 *
      	 * @param string $field
      	 * @param mixed $val
      	 * @return Query_Builder
      	 */
      	public function or_where_not_in($field, $val=array());

      	// --------------------------------------------------------------------------
      	// ! Other Query Modifier methods
      	// --------------------------------------------------------------------------

      	/**
      	 * Sets values for inserts / updates / deletes
      	 *
      	 * @param mixed $key
      	 * @param mixed $val
      	 * @return Query_Builder
      	 */
      	public function set($key, $val = NULL);

      	// --------------------------------------------------------------------------

      	/**
      	 * Creates a join phrase in a compiled query
      	 *
      	 * @param string $table
      	 * @param string $condition
      	 * @param string $type
      	 * @return Query_Builder
      	 */
      	public function join($table, $condition, $type='');

      	// --------------------------------------------------------------------------

      	/**
      	 * Group the results by the selected field(s)
      	 *
      	 * @param mixed $field
      	 * @return Query_Builder
      	 */
      	public function group_by($field);

      	// --------------------------------------------------------------------------

      	/**
      	 * Order the results by the selected field(s)
      	 *
      	 * @param string $field
      	 * @param string $type
      	 * @return Query_Builder
      	 */
      	public function order_by($field, $type="");

      	// --------------------------------------------------------------------------

      	/**
      	 * Set a limit on the current sql statement
      	 *
      	 * @param int $limit
      	 * @param int|bool $offset
      	 * @return Query_Builder
      	 */
      	public function limit($limit, $offset=FALSE);

      	// --------------------------------------------------------------------------
      	// ! Query Grouping Methods
      	// --------------------------------------------------------------------------

      	/**
      	 * Adds a paren to the current query for query grouping
      	 *
      	 * @return Query_Builder
      	 */
      	public function group_start();

      	// --------------------------------------------------------------------------

      	/**
      	 * Adds a paren to the current query for query grouping,
      	 * prefixed with 'OR'
      	 *
      	 * @return Query_Builder
      	 */
      	public function or_group_start();

      	// --------------------------------------------------------------------------

      	/**
      	 * Adds a paren to the current query for query grouping,
      	 * prefixed with 'OR NOT'
      	 *
      	 * @return Query_Builder
      	 */
      	public function or_not_group_start();

      	// --------------------------------------------------------------------------

      	/**
      	 * Ends a query group
      	 *
      	 * @return Query_Builder
      	 */
      	public function group_end();

      	// --------------------------------------------------------------------------
      	// ! Query execution methods
      	// --------------------------------------------------------------------------

      	/**
      	 * Select and retrieve all records from the current table, and/or
      	 * execute current compiled query
      	 *
      	 * @param $table
      	 * @param int|bool $limit
      	 * @param int|bool $offset
      	 * @return \PDOStatement
      	 */
      	public function get($table='', $limit=FALSE, $offset=FALSE);

      	// --------------------------------------------------------------------------

      	/**
      	 * Convience method for get() with a where clause
      	 *
      	 * @param string $table
      	 * @param array $where
      	 * @param int|bool $limit
      	 * @param int|bool $offset
      	 * @return \PDOStatement
      	 */
      	public function get_where($table, $where=array(), $limit=FALSE, $offset=FALSE);

      	// --------------------------------------------------------------------------

      	/**
      	 * Retrieve the number of rows in the selected table
      	 *
      	 * @param string $table
      	 * @return int
      	 */
      	public function count_all($table);

      	// --------------------------------------------------------------------------

      	/**
      	 * Retrieve the number of results for the generated query - used
      	 * in place of the get() method
      	 *
      	 * @param string $table
      	 * @return int
      	 */
      	public function count_all_results($table='');

      	// --------------------------------------------------------------------------

      	/**
      	 * Creates an insert clause, and executes it
      	 *
      	 * @param string $table
      	 * @param mixed $data
      	 * @return \PDOStatement
      	 */
      	public function insert($table, $data=array());

      	// --------------------------------------------------------------------------

      	/**
      	 * Creates and executes a batch insertion query
      	 *
      	 * @param string $table
      	 * @param array $data
      	 * @return \PDOStatement|null
      	 */
      	public function insert_batch($table, $data=array());

      	// --------------------------------------------------------------------------

      	/**
      	 * Creates an update clause, and executes it
      	 *
      	 * @param string $table
      	 * @param mixed $data
      	 * @return \PDOStatement
      	 */
      	public function update($table, $data=array());

      	// --------------------------------------------------------------------------

      	/**
      	 * Deletes data from a table
      	 *
      	 * @param string $table
      	 * @param mixed $where
      	 * @return \PDOStatement
      	 */
      	public function delete($table, $where='');

      	// --------------------------------------------------------------------------
      	// ! SQL Returning Methods
      	// --------------------------------------------------------------------------

      	/**
      	 * Returns the generated 'select' sql query
      	 *
      	 * @param string $table
      	 * @param bool $reset
      	 * @return string
      	 */
      	public function get_compiled_select($table='', $reset=TRUE);

      	// --------------------------------------------------------------------------

      	/**
      	 * Returns the generated 'insert' sql query
      	 *
      	 * @param string $table
      	 * @param bool $reset
      	 * @return string
      	 */
      	public function get_compiled_insert($table, $reset=TRUE);

      	// --------------------------------------------------------------------------

      	/**
      	 * Returns the generated 'update' sql query
      	 *
      	 * @param string $table
      	 * @param bool $reset
      	 * @return string
      	 */
      	public function get_compiled_update($table='', $reset=TRUE);

      	// --------------------------------------------------------------------------

      	/**
      	 * Returns the generated 'delete' sql query
      	 *
      	 * @param string $table
      	 * @param bool $reset
      	 * @return string
      	 */
      	public function get_compiled_delete($table="", $reset=TRUE);

      	// --------------------------------------------------------------------------
      	// ! Miscellaneous Methods
      	// --------------------------------------------------------------------------

      	/**
      	 * Clear out the class variables, so the next query can be run
      	 *
      	 * @return void
      	 */
      	public function reset_query();
      }

      // End of query_builder_interface.php

      Generated using phpDox 0.8.2-dev - Copyright (C) 2010 - 2015 by Arne Blankerts
      diff --git a/docs/source/Query/QueryParser.php.html b/docs/source/Query/QueryParser.php.html new file mode 100644 index 0000000..a3fd1c2 --- /dev/null +++ b/docs/source/Query/QueryParser.php.html @@ -0,0 +1,3 @@ + +phpDox - Source of QueryParser.php

      Source of file QueryParser.php

      + Size: 3,271 Bytes - Last Modified: 2015-11-10T10:01:44-05:00

      ../src/Query/QueryParser.php

      123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
      <?php
      /**
       * Query
       *
       * Free Query Builder / Database Abstraction Layer
       *
       * @package		Query
       * @author		Timothy J. Warren
       * @copyright	Copyright (c) 2012 - 2014
       * @link 		https://github.com/aviat4ion/Query
       * @license		http://philsturgeon.co.uk/code/dbad-license
       */

      // --------------------------------------------------------------------------

      namespace Query;

      /**
       * Utility Class to parse sql clauses for properly escaping identifiers
       *
       * @package Query
       * @subpackage Query_Builder
       */
      class QueryParser {

      	/**
      	 * DB Driver
      	 *
      	 * @var Driver_Interface
      	 */
      	private $db;

      	/**
      	 * Regex patterns for various syntax components
      	 *
      	 * @var array
      	 */
      	private $match_patterns = array(
      		'function' => '([a-zA-Z0-9_]+\((.*?)\))',
      		'identifier' => '([a-zA-Z0-9_-]+\.?)+',
      		'operator' => '=|AND|&&?|~|\|\|?|\^|/|>=?|<=?|-|%|OR|\+|NOT|\!=?|<>|XOR'
      	);

      	/**
      	 * Regex matches
      	 *
      	 * @var array
      	 */
      	public $matches = array(
      		'functions' => array(),
      		'identifiers' => array(),
      		'operators' => array(),
      		'combined' => array(),
      	);

      	/**
      	 * Constructor/entry point into parser
      	 *
      	 * @param Driver\Driver_Interface $db
      	 */
      	public function __construct(Driver_Interface $db)
      	{
      		$this->db = $db;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Parser method for setting the parse string
      	 *
      	 * @param string $sql
      	 * @return array
      	 */
      	public function parse_join($sql)
      	{
      		// Get sql clause components
      		preg_match_all('`'.$this->match_patterns['function'].'`', $sql, $this->matches['functions'], PREG_SET_ORDER);
      		preg_match_all('`'.$this->match_patterns['identifier'].'`', $sql, $this->matches['identifiers'], PREG_SET_ORDER);
      		preg_match_all('`'.$this->match_patterns['operator'].'`', $sql, $this->matches['operators'], PREG_SET_ORDER);

      		// Get everything at once for ordering
      		$full_pattern = '`'.$this->match_patterns['function'].'+|'.$this->match_patterns['identifier'].'|('.$this->match_patterns['operator'].')+`i';
      		preg_match_all($full_pattern, $sql, $this->matches['combined'], PREG_SET_ORDER);

      		// Go through the matches, and get the most relevant matches
      		$this->matches = array_map(array($this, 'filter_array'), $this->matches);

      		return $this->matches;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Compiles a join condition after parsing
      	 *
      	 * @param string $condition
      	 * @return string
      	 */
      	public function compile_join($condition)
      	{
      		$parts = $this->parse_join($condition);
      		$count = count($parts['identifiers']);

      		// Go through and quote the identifiers
      		for($i=0; $i <= $count; $i++)
      		{
      			if (in_array($parts['combined'][$i], $parts['identifiers']) && ! is_numeric($parts['combined'][$i]))
      			{
      				$parts['combined'][$i] = $this->db->quote_ident($parts['combined'][$i]);
      			}
      		}

      		return implode('', $parts['combined']);
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Returns a more useful match array
      	 *
      	 * @param array $array
      	 * @return array
      	 */
      	protected function filter_array($array)
      	{
      		$new_array = array();

      		foreach($array as $row)
      		{
      			$new_array[] =  (is_array($row)) ? $row[0] : $row;
      		}

      		return $new_array;
      	}

      }

      // End of query_parser.php
      Generated using phpDox 0.8.2-dev - Copyright (C) 2010 - 2015 by Arne Blankerts
      diff --git a/docs/source/Query/Query_Builder.php.html b/docs/source/Query/Query_Builder.php.html deleted file mode 100644 index c156596..0000000 --- a/docs/source/Query/Query_Builder.php.html +++ /dev/null @@ -1,3 +0,0 @@ - -phpDox - Source of Query_Builder.php

      Source of file Query_Builder.php

      - Size: 21,098 Bytes - Last Modified: 2015-11-09T19:05:36-05:00

      ../src/Query/Query_Builder.php

      123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901
      <?php
      /**
       * Query
       *
       * Free Query Builder / Database Abstraction Layer
       *
       * @package		Query
       * @author		Timothy J. Warren
       * @copyright	Copyright (c) 2012 - 2014
       * @link 		https://github.com/aviat4ion/Query
       * @license		http://philsturgeon.co.uk/code/dbad-license
       */

      // --------------------------------------------------------------------------

      namespace Query;

      // --------------------------------------------------------------------------

      /**
       * Convenience class for creating sql queries - also the class that
       * instantiates the specific db driver
       *
       * @package Query
       * @subpackage Query_Builder
       */
      class Query_Builder extends Abstract_Query_Builder implements Query_Builder_Interface {

      	/**
      	 * 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
      	// --------------------------------------------------------------------------

      	/**
      	 * Constructor
      	 *
      	 * @param Driver_Interface $db
      	 * @param Query_Parser $parser
      	 */
      	public function __construct(Driver_Interface $db, Query_Parser $parser)
      	{
      		// Inject driver and parser
      		$this->db = $db;
      		$this->parser = $parser;

      		$this->queries['total_time'] = 0;

      		// Alias driver sql and util classes
      		$this->sql = $this->db->get_sql();
      		$this->util = $this->db->get_util();
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Destructor
      	 * @codeCoverageIgnore
      	 */
      	public function __destruct()
      	{
      		$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
      	// --------------------------------------------------------------------------

      	/**
      	 * Specifies rows to select in a query
      	 *
      	 * @param string $fields
      	 * @return Query_Builder
      	 */
      	public function select($fields)
      	{
      		// Split fields by comma
      		$fields_array = explode(",", $fields);
      		$fields_array = array_map('mb_trim', $fields_array);

      		// Split on 'As'
      		foreach ($fields_array as $key => $field)
      		{
      			if (stripos($field, 'as') !== FALSE)
      			{
      				$fields_array[$key] = preg_split('` as `i', $field);
      				$fields_array[$key] = array_map('mb_trim', $fields_array[$key]);
      			}
      		}

      		// Quote the identifiers
      		$safe_array = $this->db->quote_ident($fields_array);

      		unset($fields_array);

      		// Join the strings back together
      		for($i = 0, $c = count($safe_array); $i < $c; $i++)
      		{
      			if (is_array($safe_array[$i]))
      			{
      				$safe_array[$i] = implode(' AS ', $safe_array[$i]);
      			}
      		}

      		$this->select_string .= implode(', ', $safe_array);

      		unset($safe_array);

      		return $this;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Selects the maximum value of a field from a query
      	 *
      	 * @param string $field
      	 * @param string|FALSE $as
      	 * @return Query_Builder
      	 */
      	public function select_max($field, $as=FALSE)
      	{
      		// Create the select string
      		$this->select_string .= ' MAX'.$this->_select($field, $as);
      		return $this;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Selects the minimum value of a field from a query
      	 *
      	 * @param string $field
      	 * @param string|bool $as
      	 * @return Query_Builder
      	 */
      	public function select_min($field, $as=FALSE)
      	{
      		// Create the select string
      		$this->select_string .= ' MIN'.$this->_select($field, $as);
      		return $this;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Selects the average value of a field from a query
      	 *
      	 * @param string $field
      	 * @param string|bool $as
      	 * @return Query_Builder
      	 */
      	public function select_avg($field, $as=FALSE)
      	{
      		// Create the select string
      		$this->select_string .= ' AVG'.$this->_select($field, $as);
      		return $this;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Selects the sum of a field from a query
      	 *
      	 * @param string $field
      	 * @param string|bool $as
      	 * @return Query_Builder
      	 */
      	public function select_sum($field, $as=FALSE)
      	{
      		// Create the select string
      		$this->select_string .= ' SUM'.$this->_select($field, $as);
      		return $this;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Adds the 'distinct' keyword to a query
      	 *
      	 * @return Query_Builder
      	 */
      	public function distinct()
      	{
      		// Prepend the keyword to the select string
      		$this->select_string = ' DISTINCT '.$this->select_string;
      		return $this;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Tell the database to give you the query plan instead of result set
      	 *
      	 * @return Query_Builder
      	 */
      	public function explain()
      	{
      		$this->explain = TRUE;
      		return $this;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Specify the database table to select from
      	 *
      	 * @param string $tblname
      	 * @return Query_Builder
      	 */
      	public function from($tblname)
      	{
      		// Split identifiers on spaces
      		$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]);
      		$ident_array = $this->db->quote_ident($ident_array);

      		// Paste it back together
      		$this->from_string = implode(' ', $ident_array);

      		return $this;
      	}

      	// --------------------------------------------------------------------------
      	// ! 'Like' methods
      	// --------------------------------------------------------------------------

      	/**
      	 * Creates a Like clause in the sql statement
      	 *
      	 * @param string $field
      	 * @param mixed $val
      	 * @param string $pos
      	 * @return Query_Builder
      	 */
      	public function like($field, $val, $pos='both')
      	{
      		return $this->_like($field, $val, $pos, 'LIKE', 'AND');
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Generates an OR Like clause
      	 *
      	 * @param string $field
      	 * @param mixed $val
      	 * @param string $pos
      	 * @return Query_Builder
      	 */
      	public function or_like($field, $val, $pos='both')
      	{
      		return $this->_like($field, $val, $pos, 'LIKE', 'OR');
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Generates a NOT LIKE clause
      	 *
      	 * @param string $field
      	 * @param mixed $val
      	 * @param string $pos
      	 * @return Query_Builder
      	 */
      	public function not_like($field, $val, $pos='both')
      	{
      		return $this->_like($field, $val, $pos, 'NOT LIKE', 'AND');
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Generates a OR NOT LIKE clause
      	 *
      	 * @param string $field
      	 * @param mixed $val
      	 * @param string $pos
      	 * @return Query_Builder
      	 */
      	public function or_not_like($field, $val, $pos='both')
      	{
      		return $this->_like($field, $val, $pos, 'NOT LIKE', 'OR');
      	}

      	// --------------------------------------------------------------------------
      	// ! Having methods
      	// --------------------------------------------------------------------------

      	/**
      	 * Generates a 'Having' clause
      	 *
      	 * @param mixed $key
      	 * @param mixed $val
      	 * @return Query_Builder
      	 */
      	public function having($key, $val=array())
      	{
      		return $this->_having($key, $val, 'AND');
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Generates a 'Having' clause prefixed with 'OR'
      	 *
      	 * @param mixed $key
      	 * @param mixed $val
      	 * @return Query_Builder
      	 */
      	public function or_having($key, $val=array())
      	{
      		return $this->_having($key, $val, 'OR');
      	}

      	// --------------------------------------------------------------------------
      	// ! 'Where' methods
      	// --------------------------------------------------------------------------

      	/**
      	 * Specify condition(s) in the where clause of a query
      	 * Note: this function works with key / value, or a
      	 * passed array with key / value pairs
      	 *
      	 * @param mixed $key
      	 * @param mixed $val
      	 * @param mixed $escape
      	 * @return Query_Builder
      	 */
      	public function where($key, $val=array(), $escape=NULL)
      	{
      		return $this->_where_string($key, $val, 'AND');
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Where clause prefixed with "OR"
      	 *
      	 * @param string $key
      	 * @param mixed $val
      	 * @return Query_Builder
      	 */
      	public function or_where($key, $val=array())
      	{
      		return $this->_where_string($key, $val, 'OR');
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Where clause with 'IN' statement
      	 *
      	 * @param mixed $field
      	 * @param mixed $val
      	 * @return Query_Builder
      	 */
      	public function where_in($field, $val=array())
      	{
      		return $this->_where_in($field, $val);
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Where in statement prefixed with "or"
      	 *
      	 * @param string $field
      	 * @param mixed $val
      	 * @return Query_Builder
      	 */
      	public function or_where_in($field, $val=array())
      	{
      		return $this->_where_in($field, $val, 'IN', 'OR');
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * WHERE NOT IN (FOO) clause
      	 *
      	 * @param string $field
      	 * @param mixed $val
      	 * @return Query_Builder
      	 */
      	public function where_not_in($field, $val=array())
      	{
      		return $this->_where_in($field, $val, 'NOT IN', 'AND');
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * OR WHERE NOT IN (FOO) clause
      	 *
      	 * @param string $field
      	 * @param mixed $val
      	 * @return Query_Builder
      	 */
      	public function or_where_not_in($field, $val=array())
      	{
      		return $this->_where_in($field, $val, 'NOT IN', 'OR');
      	}

      	// --------------------------------------------------------------------------
      	// ! Other Query Modifier methods
      	// --------------------------------------------------------------------------

      	/**
      	 * Sets values for inserts / updates / deletes
      	 *
      	 * @param mixed $key
      	 * @param mixed $val
      	 * @return Query_Builder
      	 */
      	public function set($key, $val = NULL)
      	{
      		$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
      		$this->set_array_keys = array_map(array($this->db, '_quote'), $this->set_array_keys);

      		// Generate the "set" string
      		$this->set_string = implode('=?,', $this->set_array_keys);
      		$this->set_string .= '=?';

      		return $this;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Creates a join phrase in a compiled query
      	 *
      	 * @param string $table
      	 * @param string $condition
      	 * @param string $type
      	 * @return Query_Builder
      	 */
      	public function join($table, $condition, $type='')
      	{
      		// Prefix and quote table name
      		$table = explode(' ', mb_trim($table));
      		$table[0] = $this->db->quote_table($table[0]);
      		$table = $this->db->quote_ident($table);
      		$table = implode(' ', $table);

      		// Parse out the join condition
      		$parsed_condition = $this->parser->compile_join($condition);
      		$condition = $table . ' ON ' . $parsed_condition;

      		$this->_append_map("\n" . strtoupper($type) . ' JOIN ', $condition, 'join');

      		return $this;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Group the results by the selected field(s)
      	 *
      	 * @param mixed $field
      	 * @return Query_Builder
      	 */
      	public function group_by($field)
      	{
      		if ( ! is_scalar($field))
      		{
      			$new_group_array = array_map(array($this->db, 'quote_ident'), $field);
      			$this->group_array = array_merge($this->group_array, $new_group_array);
      		}
      		else
      		{
      			$this->group_array[] = $this->db->quote_ident($field);
      		}

      		$this->group_string = ' GROUP BY ' . implode(',', $this->group_array);

      		return $this;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Order the results by the selected field(s)
      	 *
      	 * @param string $field
      	 * @param string $type
      	 * @return Query_Builder
      	 */
      	public function order_by($field, $type="")
      	{
      		// When ordering by random, do an ascending order if the driver
      		// doesn't support random ordering
      		if (stripos($type, 'rand') !== FALSE)
      		{
      			$rand = $this->sql->random();
      			$type = ($rand !== FALSE) ? $rand : 'ASC';
      		}

      		// Set fields for later manipulation
      		$field = $this->db->quote_ident($field);
      		$this->order_array[$field] = $type;

      		$order_clauses = array();

      		// Flatten key/val pairs into an array of space-separated pairs
      		foreach($this->order_array as $k => $v)
      		{
      			$order_clauses[] = $k . ' ' . strtoupper($v);
      		}

      		// Set the final string
      		$this->order_string = ( ! isset($rand))
      			? "\nORDER BY ".implode(', ', $order_clauses)
      			: "\nORDER BY".$rand;

      		return $this;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Set a limit on the current sql statement
      	 *
      	 * @param int $limit
      	 * @param int|bool $offset
      	 * @return Query_Builder
      	 */
      	public function limit($limit, $offset=FALSE)
      	{
      		$this->limit = (int) $limit;
      		$this->offset = $offset;

      		return $this;
      	}

      	// --------------------------------------------------------------------------
      	// ! Query Grouping Methods
      	// --------------------------------------------------------------------------

      	/**
      	 * Adds a paren to the current query for query grouping
      	 *
      	 * @return Query_Builder
      	 */
      	public function group_start()
      	{
      		$conj = (empty($this->query_map)) ? ' WHERE ' : ' ';

      		$this->_append_map($conj, '(', 'group_start');

      		return $this;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Adds a paren to the current query for query grouping,
      	 * prefixed with 'OR'
      	 *
      	 * @return Query_Builder
      	 */
      	public function or_group_start()
      	{
      		$this->_append_map('', ' OR (', 'group_start');

      		return $this;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Adds a paren to the current query for query grouping,
      	 * prefixed with 'OR NOT'
      	 *
      	 * @return Query_Builder
      	 */
      	public function or_not_group_start()
      	{
      		$this->_append_map('', ' OR NOT (', 'group_start');

      		return $this;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Ends a query group
      	 *
      	 * @return Query_Builder
      	 */
      	public function group_end()
      	{
      		$this->_append_map('', ')', 'group_end');

      		return $this;
      	}

      	// --------------------------------------------------------------------------
      	// ! Query execution methods
      	// --------------------------------------------------------------------------

      	/**
      	 * Select and retrieve all records from the current table, and/or
      	 * execute current compiled query
      	 *
      	 * @param $table
      	 * @param int|bool $limit
      	 * @param int|bool $offset
      	 * @return \PDOStatement
      	 */
      	public function get($table='', $limit=FALSE, $offset=FALSE)
      	{
      		// Set the table
      		if ( ! empty($table)) $this->from($table);

      		// Set the limit, if it exists
      		if (is_int($limit)) $this->limit($limit, $offset);

      		return $this->_run("get", $table);
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Convenience method for get() with a where clause
      	 *
      	 * @param string $table
      	 * @param array $where
      	 * @param int|bool $limit
      	 * @param int|bool $offset
      	 * @return \PDOStatement
      	 */
      	public function get_where($table, $where=array(), $limit=FALSE, $offset=FALSE)
      	{
      		// Create the where clause
      		$this->where($where);

      		// Return the result
      		return $this->get($table, $limit, $offset);
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Retreive the number of rows in the selected table
      	 *
      	 * @param string $table
      	 * @return int
      	 */
      	public function count_all($table)
      	{
      		$sql = 'SELECT * FROM '.$this->db->quote_table($table);
      		$res = $this->db->query($sql);
      		return (int) count($res->fetchAll());
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Retrieve the number of results for the generated query - used
      	 * in place of the get() method
      	 *
      	 * @param string $table
      	 * @return int
      	 */
      	public function count_all_results($table='')
      	{
      		// Set the table
      		if ( ! empty($table)) $this->from($table);

      		$result = $this->_run('get', $table);
      		$rows = $result->fetchAll();

      		return (int) count($rows);
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Creates an insert clause, and executes it
      	 *
      	 * @param string $table
      	 * @param mixed $data
      	 * @return \PDOStatement
      	 */
      	public function insert($table, $data=array())
      	{
      		// No use duplicating logic!
      		if ( ! empty($data)) $this->set($data);

      		return $this->_run("insert", $table);
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Creates and executes a batch insertion query
      	 *
      	 * @param string $table
      	 * @param array $data
      	 * @return \PDOStatement
      	 */
      	public function insert_batch($table, $data=array())
      	{
      		// Get the generated values and sql string
      		list($sql, $data) = $this->db->insert_batch($table, $data);

      		return ( ! is_null($sql))
      			? $this->_run('', $table, $sql, $data)
      			: NULL;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Creates an update clause, and executes it
      	 *
      	 * @param string $table
      	 * @param mixed $data
      	 * @return \PDOStatement
      	 */
      	public function update($table, $data=array())
      	{
      		// No use duplicating logic!
      		if ( ! empty($data)) $this->set($data);

      		return $this->_run("update", $table);
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Deletes data from a table
      	 *
      	 * @param string $table
      	 * @param mixed $where
      	 * @return \PDOStatement
      	 */
      	public function delete($table, $where='')
      	{
      		// Set the where clause
      		if ( ! empty($where)) $this->where($where);

      		return $this->_run("delete", $table);
      	}

      	// --------------------------------------------------------------------------
      	// ! SQL Returning Methods
      	// --------------------------------------------------------------------------



      	/**
      	 * Returns the generated 'select' sql query
      	 *
      	 * @param string $table
      	 * @param bool $reset
      	 * @return string
      	 */
      	public function get_compiled_select($table='', $reset=TRUE)
      	{
      		// Set the table
      		if ( ! empty($table)) $this->from($table);

      		return $this->_get_compile('select', $table, $reset);
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Returns the generated 'insert' sql query
      	 *
      	 * @param string $table
      	 * @param bool $reset
      	 * @return string
      	 */
      	public function get_compiled_insert($table, $reset=TRUE)
      	{
      		return $this->_get_compile('insert', $table, $reset);
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Returns the generated 'update' sql query
      	 *
      	 * @param string $table
      	 * @param bool $reset
      	 * @return string
      	 */
      	public function get_compiled_update($table='', $reset=TRUE)
      	{
      		return $this->_get_compile('update', $table, $reset);
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Returns the generated 'delete' sql query
      	 *
      	 * @param string $table
      	 * @param bool $reset
      	 * @return string
      	 */
      	public function get_compiled_delete($table="", $reset=TRUE)
      	{
      		return $this->_get_compile('delete', $table, $reset);
      	}


      	// --------------------------------------------------------------------------
      	// ! Miscellaneous Methods
      	// --------------------------------------------------------------------------

      	/**
      	 * Clear out the class variables, so the next query can be run
      	 *
      	 * @return void
      	 */
      	public function reset_query()
      	{
      		// Reset strings and booleans
      		foreach($this->string_vars as $var)
      		{
      			$this->$var = NULL;
      		}

      		// Reset arrays
      		foreach($this->array_vars as $var)
      		{
      			$this->$var = array();
      		}
      	}
      }
      // End of query_builder.php
      Generated using phpDox 0.8.2-dev - Copyright (C) 2010 - 2015 by Arne Blankerts
      diff --git a/docs/source/Query/Query_Builder_Interface.php.html b/docs/source/Query/Query_Builder_Interface.php.html deleted file mode 100644 index 3159ed3..0000000 --- a/docs/source/Query/Query_Builder_Interface.php.html +++ /dev/null @@ -1,3 +0,0 @@ - -phpDox - Source of Query_Builder_Interface.php

      Source of file Query_Builder_Interface.php

      - Size: 12,437 Bytes - Last Modified: 2015-07-30T13:16:26-04:00

      ../src/Query/Query_Builder_Interface.php

      123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504
      <?php
      /**
       * Query
       *
       * Free Query Builder / Database Abstraction Layer
       *
       * @package		Query
       * @author		Timothy J. Warren
       * @copyright	Copyright (c) 2012 - 2014
       * @link 		https://github.com/aviat4ion/Query
       * @license		http://philsturgeon.co.uk/code/dbad-license
       */

      // --------------------------------------------------------------------------

      namespace Query;

      /**
       * Interface defining the Query Builder class
       *
       * @package Query
       * @subpackage Query_Builder
       */
      interface Query_Builder_Interface {

      	// --------------------------------------------------------------------------
      	// ! Select Queries
      	// --------------------------------------------------------------------------

      	/**
      	 * Specifies rows to select in a query
      	 *
      	 * @param string $fields
      	 * @return Query_Builder
      	 */
      	public function select($fields);

      	// --------------------------------------------------------------------------

      	/**
      	 * Selects the maximum value of a field from a query
      	 *
      	 * @param string $field
      	 * @param string|bool $as
      	 * @return Query_Builder
      	 */
      	public function select_max($field, $as=FALSE);

      	// --------------------------------------------------------------------------

      	/**
      	 * Selects the minimum value of a field from a query
      	 *
      	 * @param string $field
      	 * @param string|bool $as
      	 * @return Query_Builder
      	 */
      	public function select_min($field, $as=FALSE);

      	// --------------------------------------------------------------------------

      	/**
      	 * Selects the average value of a field from a query
      	 *
      	 * @param string $field
      	 * @param string|bool $as
      	 * @return Query_Builder
      	 */
      	public function select_avg($field, $as=FALSE);

      	// --------------------------------------------------------------------------

      	/**
      	 * Selects the sum of a field from a query
      	 *
      	 * @param string $field
      	 * @param string|bool $as
      	 * @return Query_Builder
      	 */
      	public function select_sum($field, $as=FALSE);

      	// --------------------------------------------------------------------------

      	/**
      	 * Adds the 'distinct' keyword to a query
      	 *
      	 * @return Query_Builder
      	 */
      	public function distinct();

      	// --------------------------------------------------------------------------

      	/**
      	 * Shows the query plan for the query
      	 *
      	 * @return Query_Builder
      	 */
      	public function explain();

      	// --------------------------------------------------------------------------

      	/**
      	 * Specify the database table to select from
      	 *
      	 * @param string $tblname
      	 * @return Query_Builder
      	 */
      	public function from($tblname);

      	// --------------------------------------------------------------------------
      	// ! 'Like' methods
      	// --------------------------------------------------------------------------

      	/**
      	 * Creates a Like clause in the sql statement
      	 *
      	 * @param string $field
      	 * @param mixed $val
      	 * @param string $pos
      	 * @return Query_Builder
      	 */
      	public function like($field, $val, $pos='both');

      	// --------------------------------------------------------------------------

      	/**
      	 * Generates an OR Like clause
      	 *
      	 * @param string $field
      	 * @param mixed $val
      	 * @param string $pos
      	 * @return Query_Builder
      	 */
      	public function or_like($field, $val, $pos='both');

      	// --------------------------------------------------------------------------

      	/**
      	 * Generates a NOT LIKE clause
      	 *
      	 * @param string $field
      	 * @param mixed $val
      	 * @param string $pos
      	 * @return Query_Builder
      	 */
      	public function not_like($field, $val, $pos='both');

      	// --------------------------------------------------------------------------

      	/**
      	 * Generates a OR NOT LIKE clause
      	 *
      	 * @param string $field
      	 * @param mixed $val
      	 * @param string $pos
      	 * @return Query_Builder
      	 */
      	public function or_not_like($field, $val, $pos='both');

      	// --------------------------------------------------------------------------
      	// ! Having methods
      	// --------------------------------------------------------------------------

      	/**
      	 * Generates a 'Having' clause
      	 *
      	 * @param mixed $key
      	 * @param mixed $val
      	 * @return Query_Builder
      	 */
      	public function having($key, $val=array());

      	// --------------------------------------------------------------------------

      	/**
      	 * Generates a 'Having' clause prefixed with 'OR'
      	 *
      	 * @param mixed $key
      	 * @param mixed $val
      	 * @return Query_Builder
      	 */
      	public function or_having($key, $val=array());

      	// --------------------------------------------------------------------------
      	// ! 'Where' methods
      	// --------------------------------------------------------------------------

      	/**
      	 * Specify condition(s) in the where clause of a query
      	 * Note: this function works with key / value, or a
      	 * passed array with key / value pairs
      	 *
      	 * @param mixed $key
      	 * @param mixed $val
      	 * @param bool $escape
      	 * @return Query_Builder
      	 */
      	public function where($key, $val=array(), $escape = NULL);

      	// --------------------------------------------------------------------------

      	/**
      	 * Where clause prefixed with "OR"
      	 *
      	 * @param string $key
      	 * @param mixed $val
      	 * @return Query_Builder
      	 */
      	public function or_where($key, $val=array());

      	// --------------------------------------------------------------------------

      	/**
      	 * Where clause with 'IN' statement
      	 *
      	 * @param mixed $field
      	 * @param mixed $val
      	 * @return Query_Builder
      	 */
      	public function where_in($field, $val=array());

      	// --------------------------------------------------------------------------

      	/**
      	 * Where in statement prefixed with "or"
      	 *
      	 * @param string $field
      	 * @param mixed $val
      	 * @return Query_Builder
      	 */
      	public function or_where_in($field, $val=array());

      	// --------------------------------------------------------------------------

      	/**
      	 * WHERE NOT IN (FOO) clause
      	 *
      	 * @param string $field
      	 * @param mixed $val
      	 * @return Query_Builder
      	 */
      	public function where_not_in($field, $val=array());

      	// --------------------------------------------------------------------------

      	/**
      	 * OR WHERE NOT IN (FOO) clause
      	 *
      	 * @param string $field
      	 * @param mixed $val
      	 * @return Query_Builder
      	 */
      	public function or_where_not_in($field, $val=array());

      	// --------------------------------------------------------------------------
      	// ! Other Query Modifier methods
      	// --------------------------------------------------------------------------

      	/**
      	 * Sets values for inserts / updates / deletes
      	 *
      	 * @param mixed $key
      	 * @param mixed $val
      	 * @return Query_Builder
      	 */
      	public function set($key, $val = NULL);

      	// --------------------------------------------------------------------------

      	/**
      	 * Creates a join phrase in a compiled query
      	 *
      	 * @param string $table
      	 * @param string $condition
      	 * @param string $type
      	 * @return Query_Builder
      	 */
      	public function join($table, $condition, $type='');

      	// --------------------------------------------------------------------------

      	/**
      	 * Group the results by the selected field(s)
      	 *
      	 * @param mixed $field
      	 * @return Query_Builder
      	 */
      	public function group_by($field);

      	// --------------------------------------------------------------------------

      	/**
      	 * Order the results by the selected field(s)
      	 *
      	 * @param string $field
      	 * @param string $type
      	 * @return Query_Builder
      	 */
      	public function order_by($field, $type="");

      	// --------------------------------------------------------------------------

      	/**
      	 * Set a limit on the current sql statement
      	 *
      	 * @param int $limit
      	 * @param int|bool $offset
      	 * @return Query_Builder
      	 */
      	public function limit($limit, $offset=FALSE);

      	// --------------------------------------------------------------------------
      	// ! Query Grouping Methods
      	// --------------------------------------------------------------------------

      	/**
      	 * Adds a paren to the current query for query grouping
      	 *
      	 * @return Query_Builder
      	 */
      	public function group_start();

      	// --------------------------------------------------------------------------

      	/**
      	 * Adds a paren to the current query for query grouping,
      	 * prefixed with 'OR'
      	 *
      	 * @return Query_Builder
      	 */
      	public function or_group_start();

      	// --------------------------------------------------------------------------

      	/**
      	 * Adds a paren to the current query for query grouping,
      	 * prefixed with 'OR NOT'
      	 *
      	 * @return Query_Builder
      	 */
      	public function or_not_group_start();

      	// --------------------------------------------------------------------------

      	/**
      	 * Ends a query group
      	 *
      	 * @return Query_Builder
      	 */
      	public function group_end();

      	// --------------------------------------------------------------------------
      	// ! Query execution methods
      	// --------------------------------------------------------------------------

      	/**
      	 * Select and retrieve all records from the current table, and/or
      	 * execute current compiled query
      	 *
      	 * @param $table
      	 * @param int|bool $limit
      	 * @param int|bool $offset
      	 * @return \PDOStatement
      	 */
      	public function get($table='', $limit=FALSE, $offset=FALSE);

      	// --------------------------------------------------------------------------

      	/**
      	 * Convience method for get() with a where clause
      	 *
      	 * @param string $table
      	 * @param array $where
      	 * @param int|bool $limit
      	 * @param int|bool $offset
      	 * @return \PDOStatement
      	 */
      	public function get_where($table, $where=array(), $limit=FALSE, $offset=FALSE);

      	// --------------------------------------------------------------------------

      	/**
      	 * Retrieve the number of rows in the selected table
      	 *
      	 * @param string $table
      	 * @return int
      	 */
      	public function count_all($table);

      	// --------------------------------------------------------------------------

      	/**
      	 * Retrieve the number of results for the generated query - used
      	 * in place of the get() method
      	 *
      	 * @param string $table
      	 * @return int
      	 */
      	public function count_all_results($table='');

      	// --------------------------------------------------------------------------

      	/**
      	 * Creates an insert clause, and executes it
      	 *
      	 * @param string $table
      	 * @param mixed $data
      	 * @return \PDOStatement
      	 */
      	public function insert($table, $data=array());

      	// --------------------------------------------------------------------------

      	/**
      	 * Creates and executes a batch insertion query
      	 *
      	 * @param string $table
      	 * @param array $data
      	 * @return \PDOStatement|null
      	 */
      	public function insert_batch($table, $data=array());

      	// --------------------------------------------------------------------------

      	/**
      	 * Creates an update clause, and executes it
      	 *
      	 * @param string $table
      	 * @param mixed $data
      	 * @return \PDOStatement
      	 */
      	public function update($table, $data=array());

      	// --------------------------------------------------------------------------

      	/**
      	 * Deletes data from a table
      	 *
      	 * @param string $table
      	 * @param mixed $where
      	 * @return \PDOStatement
      	 */
      	public function delete($table, $where='');

      	// --------------------------------------------------------------------------
      	// ! SQL Returning Methods
      	// --------------------------------------------------------------------------

      	/**
      	 * Returns the generated 'select' sql query
      	 *
      	 * @param string $table
      	 * @param bool $reset
      	 * @return string
      	 */
      	public function get_compiled_select($table='', $reset=TRUE);

      	// --------------------------------------------------------------------------

      	/**
      	 * Returns the generated 'insert' sql query
      	 *
      	 * @param string $table
      	 * @param bool $reset
      	 * @return string
      	 */
      	public function get_compiled_insert($table, $reset=TRUE);

      	// --------------------------------------------------------------------------

      	/**
      	 * Returns the generated 'update' sql query
      	 *
      	 * @param string $table
      	 * @param bool $reset
      	 * @return string
      	 */
      	public function get_compiled_update($table='', $reset=TRUE);

      	// --------------------------------------------------------------------------

      	/**
      	 * Returns the generated 'delete' sql query
      	 *
      	 * @param string $table
      	 * @param bool $reset
      	 * @return string
      	 */
      	public function get_compiled_delete($table="", $reset=TRUE);

      	// --------------------------------------------------------------------------
      	// ! Miscellaneous Methods
      	// --------------------------------------------------------------------------

      	/**
      	 * Clear out the class variables, so the next query can be run
      	 *
      	 * @return void
      	 */
      	public function reset_query();
      }

      // End of query_builder_interface.php

      Generated using phpDox 0.8.2-dev - Copyright (C) 2010 - 2015 by Arne Blankerts
      diff --git a/docs/source/Query/Query_Parser.php.html b/docs/source/Query/Query_Parser.php.html deleted file mode 100644 index 33e4280..0000000 --- a/docs/source/Query/Query_Parser.php.html +++ /dev/null @@ -1,3 +0,0 @@ - -phpDox - Source of Query_Parser.php

      Source of file Query_Parser.php

      - Size: 3,272 Bytes - Last Modified: 2015-07-31T09:24:29-04:00

      ../src/Query/Query_Parser.php

      123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
      <?php
      /**
       * Query
       *
       * Free Query Builder / Database Abstraction Layer
       *
       * @package		Query
       * @author		Timothy J. Warren
       * @copyright	Copyright (c) 2012 - 2014
       * @link 		https://github.com/aviat4ion/Query
       * @license		http://philsturgeon.co.uk/code/dbad-license
       */

      // --------------------------------------------------------------------------

      namespace Query;

      /**
       * Utility Class to parse sql clauses for properly escaping identifiers
       *
       * @package Query
       * @subpackage Query_Builder
       */
      class Query_Parser {

      	/**
      	 * DB Driver
      	 *
      	 * @var Driver_Interface
      	 */
      	private $db;

      	/**
      	 * Regex patterns for various syntax components
      	 *
      	 * @var array
      	 */
      	private $match_patterns = array(
      		'function' => '([a-zA-Z0-9_]+\((.*?)\))',
      		'identifier' => '([a-zA-Z0-9_-]+\.?)+',
      		'operator' => '=|AND|&&?|~|\|\|?|\^|/|>=?|<=?|-|%|OR|\+|NOT|\!=?|<>|XOR'
      	);

      	/**
      	 * Regex matches
      	 *
      	 * @var array
      	 */
      	public $matches = array(
      		'functions' => array(),
      		'identifiers' => array(),
      		'operators' => array(),
      		'combined' => array(),
      	);

      	/**
      	 * Constructor/entry point into parser
      	 *
      	 * @param Driver\Driver_Interface $db
      	 */
      	public function __construct(Driver_Interface $db)
      	{
      		$this->db = $db;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Parser method for setting the parse string
      	 *
      	 * @param string $sql
      	 * @return array
      	 */
      	public function parse_join($sql)
      	{
      		// Get sql clause components
      		preg_match_all('`'.$this->match_patterns['function'].'`', $sql, $this->matches['functions'], PREG_SET_ORDER);
      		preg_match_all('`'.$this->match_patterns['identifier'].'`', $sql, $this->matches['identifiers'], PREG_SET_ORDER);
      		preg_match_all('`'.$this->match_patterns['operator'].'`', $sql, $this->matches['operators'], PREG_SET_ORDER);

      		// Get everything at once for ordering
      		$full_pattern = '`'.$this->match_patterns['function'].'+|'.$this->match_patterns['identifier'].'|('.$this->match_patterns['operator'].')+`i';
      		preg_match_all($full_pattern, $sql, $this->matches['combined'], PREG_SET_ORDER);

      		// Go through the matches, and get the most relevant matches
      		$this->matches = array_map(array($this, 'filter_array'), $this->matches);

      		return $this->matches;
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Compiles a join condition after parsing
      	 *
      	 * @param string $condition
      	 * @return string
      	 */
      	public function compile_join($condition)
      	{
      		$parts = $this->parse_join($condition);
      		$count = count($parts['identifiers']);

      		// Go through and quote the identifiers
      		for($i=0; $i <= $count; $i++)
      		{
      			if (in_array($parts['combined'][$i], $parts['identifiers']) && ! is_numeric($parts['combined'][$i]))
      			{
      				$parts['combined'][$i] = $this->db->quote_ident($parts['combined'][$i]);
      			}
      		}

      		return implode('', $parts['combined']);
      	}

      	// --------------------------------------------------------------------------

      	/**
      	 * Returns a more useful match array
      	 *
      	 * @param array $array
      	 * @return array
      	 */
      	protected function filter_array($array)
      	{
      		$new_array = array();

      		foreach($array as $row)
      		{
      			$new_array[] =  (is_array($row)) ? $row[0] : $row;
      		}

      		return $new_array;
      	}

      }

      // End of query_parser.php
      Generated using phpDox 0.8.2-dev - Copyright (C) 2010 - 2015 by Arne Blankerts
      diff --git a/docs/source/Query/SQLInterface.php.html b/docs/source/Query/SQLInterface.php.html new file mode 100644 index 0000000..a7e7cf8 --- /dev/null +++ b/docs/source/Query/SQLInterface.php.html @@ -0,0 +1,3 @@ + +phpDox - Source of SQLInterface.php

      Source of file SQLInterface.php

      + Size: 2,344 Bytes - Last Modified: 2015-11-10T11:02:11-05:00

      ../src/Query/SQLInterface.php

      123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
      <?php
      /**
       * Query
       *
       * Free Query Builder / Database Abstraction Layer
       *
       * @author		Timothy J. Warren
       * @copyright	Copyright (c) 2012 - 2014
       * @link 		https://github.com/aviat4ion/Query
       * @license		http://philsturgeon.co.uk/code/dbad-license
       * @package		Query
       */

      // --------------------------------------------------------------------------

      namespace Query;

      /**
       * parent for database manipulation subclasses
       *
       * @package Query
       * @subpackage Drivers
       */
      interface SQLInterface {

      	/**
      	 * Get database specific sql for limit clause
      	 *
      	 * @param string $sql
      	 * @param int $limit
      	 * @param int|bool $offset
      	 * @return string
      	 */
      	public function limit($sql, $limit, $offset=FALSE);

      	/**
      	 * Modify the query to get the query plan
      	 *
      	 * @param string $sql
      	 * @return string
      	 */
      	public function explain($sql);

      	/**
      	 * Get the sql for random ordering
      	 *
      	 * @return string
      	 */
      	public function random();

      	/**
      	 * Returns sql to list other databases
      	 *
      	 * @return string
      	 */
      	public function db_list();

      	/**
      	 * Returns sql to list tables
      	 *
      	 * @return string
      	 */
      	public function table_list();

      	/**
      	 * Returns sql to list system tables
      	 *
      	 * @return string
      	 */
      	public function system_table_list();

      	/**
      	 * Returns sql to list views
      	 *
      	 * @return string
      	 */
      	public function view_list();

      	/**
      	 * Returns sql to list triggers
      	 *
      	 * @return string
      	 */
      	public function trigger_list();

      	/**
      	 * Return sql to list functions
      	 *
      	 * @return NULL
      	 */
      	public function function_list();

      	/**
      	 * Return sql to list stored procedures
      	 *
      	 * @return string
      	 */
      	public function procedure_list();

      	/**
      	 * Return sql to list sequences
      	 *
      	 * @return string
      	 */
      	public function sequence_list();

      	/**
      	 * Return sql to list database field types
      	 *
      	 * @return string|array
      	 */
      	public function type_list();

      	/**
      	 * Get information about the columns in the
      	 * specified table
      	 *
      	 * @param string $table
      	 * @return string
      	 */
      	public function column_list($table);

      	/**
      	 * Get the list of foreign keys for the current
      	 * table
      	 *
      	 * @param string $table
      	 * @return array
      	 */
      	public function fk_list($table);

      	/**
      	 * Get the list of indexes for the current table
      	 *
      	 * @param string $table
      	 * @return array
      	 */
      	public function index_list($table);

      }
      // End of sql_interface.php
      Generated using phpDox 0.8.2-dev - Copyright (C) 2010 - 2015 by Arne Blankerts
      diff --git a/docs/source/Query/SQL_Interface.php.html b/docs/source/Query/SQL_Interface.php.html deleted file mode 100644 index 02212b2..0000000 --- a/docs/source/Query/SQL_Interface.php.html +++ /dev/null @@ -1,3 +0,0 @@ - -phpDox - Source of SQL_Interface.php

      Source of file SQL_Interface.php

      - Size: 2,345 Bytes - Last Modified: 2015-07-16T15:13:05-04:00

      ../src/Query/SQL_Interface.php

      123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
      <?php
      /**
       * Query
       *
       * Free Query Builder / Database Abstraction Layer
       *
       * @author		Timothy J. Warren
       * @copyright	Copyright (c) 2012 - 2014
       * @link 		https://github.com/aviat4ion/Query
       * @license		http://philsturgeon.co.uk/code/dbad-license
       * @package		Query
       */

      // --------------------------------------------------------------------------

      namespace Query;

      /**
       * parent for database manipulation subclasses
       *
       * @package Query
       * @subpackage Drivers
       */
      interface SQL_Interface {

      	/**
      	 * Get database specific sql for limit clause
      	 *
      	 * @param string $sql
      	 * @param int $limit
      	 * @param int|bool $offset
      	 * @return string
      	 */
      	public function limit($sql, $limit, $offset=FALSE);

      	/**
      	 * Modify the query to get the query plan
      	 *
      	 * @param string $sql
      	 * @return string
      	 */
      	public function explain($sql);

      	/**
      	 * Get the sql for random ordering
      	 *
      	 * @return string
      	 */
      	public function random();

      	/**
      	 * Returns sql to list other databases
      	 *
      	 * @return string
      	 */
      	public function db_list();

      	/**
      	 * Returns sql to list tables
      	 *
      	 * @return string
      	 */
      	public function table_list();

      	/**
      	 * Returns sql to list system tables
      	 *
      	 * @return string
      	 */
      	public function system_table_list();

      	/**
      	 * Returns sql to list views
      	 *
      	 * @return string
      	 */
      	public function view_list();

      	/**
      	 * Returns sql to list triggers
      	 *
      	 * @return string
      	 */
      	public function trigger_list();

      	/**
      	 * Return sql to list functions
      	 *
      	 * @return NULL
      	 */
      	public function function_list();

      	/**
      	 * Return sql to list stored procedures
      	 *
      	 * @return string
      	 */
      	public function procedure_list();

      	/**
      	 * Return sql to list sequences
      	 *
      	 * @return string
      	 */
      	public function sequence_list();

      	/**
      	 * Return sql to list database field types
      	 *
      	 * @return string|array
      	 */
      	public function type_list();

      	/**
      	 * Get information about the columns in the
      	 * specified table
      	 *
      	 * @param string $table
      	 * @return string
      	 */
      	public function column_list($table);

      	/**
      	 * Get the list of foreign keys for the current
      	 * table
      	 *
      	 * @param string $table
      	 * @return array
      	 */
      	public function fk_list($table);

      	/**
      	 * Get the list of indexes for the current table
      	 *
      	 * @param string $table
      	 * @return array
      	 */
      	public function index_list($table);

      }
      // End of sql_interface.php
      Generated using phpDox 0.8.2-dev - Copyright (C) 2010 - 2015 by Arne Blankerts
      diff --git a/docs/source/common.php.html b/docs/source/common.php.html index eaea147..0e29e55 100644 --- a/docs/source/common.php.html +++ b/docs/source/common.php.html @@ -1,3 +1,3 @@ phpDox - Source of common.php

      Source of file common.php

      - Size: 4,775 Bytes - Last Modified: 2015-07-30T14:31:59-04:00

      ../src/common.php

      123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225
      <?php
      /**
       * Query
       *
       * Free Query Builder / Database Abstraction Layer
       *
       * @package		Query
       * @subpackage	Core
       * @author		Timothy J. Warren
       * @copyright	Copyright (c) 2012 - 2014
       * @link 		https://github.com/aviat4ion/Query
       * @license		http://philsturgeon.co.uk/code/dbad-license
       */

      // --------------------------------------------------------------------------

      /**
       * Global functions that don't really fit anywhere else
       */

      // --------------------------------------------------------------------------

      if ( ! function_exists('do_include'))
      {
      	/**
      	 * Bulk directory loading workaround for use
      	 * with array_map and glob
      	 *
      	 * @param string $path
      	 * @return void
      	 */
      	function do_include($path)
      	{
      		require_once($path);
      	}
      }

      // --------------------------------------------------------------------------

      if ( ! function_exists('mb_trim'))
      {
      	/**
      	 * Multibyte-safe trim function
      	 *
      	 * @param string $string
      	 * @return string
      	 */
      	function mb_trim($string)
      	{
      		return preg_replace("/(^\s+)|(\s+$)/us", "", $string);
      	}
      }

      // --------------------------------------------------------------------------

      if ( ! function_exists('db_filter'))
      {
      	/**
      	 * Filter out db rows into one array
      	 *
      	 * @param array $array
      	 * @param mixed $index
      	 * @return array
      	 */
      	function db_filter($array, $index)
      	{
      		$new_array = array();

      		foreach($array as $a)
      		{
      			$new_array[] = $a[$index];
      		}

      		return $new_array;
      	}
      }

      // --------------------------------------------------------------------------

      if ( ! function_exists('from_camel_case'))
      {
      	/**
      	 * Create a snake_case string from camelCase
      	 *
      	 * @see http://stackoverflow.com/questions/1993721/how-to-convert-camelcase-to-camel-case
      	 *
      	 * @param string $input
      	 * @return string
      	 */
      	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 = strtolower($match);// == strtoupper($match) ? strtolower($match) : lcfirst($match);
      		}
      		return implode('_', $ret);
      	}
      }

      // --------------------------------------------------------------------------

      if ( ! function_exists('array_zipper'))
      {
      	/**
      	 * Zip a set of arrays together on common keys
      	 *
      	 * The $zipper_input array is an array of arrays indexed by their place in the output
      	 * array.
      	 *
      	 * @param array $zipper_input
      	 * @return array
      	 */
      	function array_zipper(Array $zipper_input)
      	{
      		$output = array();

      		foreach($zipper_input as $append_key => $values)
      		{
      			foreach($values as $index => $value)
      			{
      				if ( ! isset($output[$index]))
      				{
      					$output[$index] = array();
      				}
      				$output[$index][$append_key] = $value;
      			}
      		}

      		return $output;
      	}
      }

      // --------------------------------------------------------------------------

      if ( ! function_exists('array_pluck'))
      {
      	/**
      	 * Get an array out of an multi-dimensional array based on a common
      	 * key
      	 *
      	 * @param array $array
      	 * @param string $key
      	 * @return array
      	 */
      	function array_pluck(Array $array, $key)
      	{
      		$output = array();

      		// No point iterating over an empty array
      		if (empty($array)) return $array;

      		foreach($array as $inner_array)
      		{
      	 		if (array_key_exists($key, $inner_array))
      	 		{
      		 		$output[] = $inner_array[$key];
      	 		}
      		}

      		return $output;
      	}
      }

      // --------------------------------------------------------------------------

      if ( ! function_exists('regex_in_array'))
      {
      	/**
      	 * Determine whether a value in the passed array matches the pattern
      	 * passed
      	 *
      	 * @param array $array
      	 * @param string $pattern
      	 * @return bool
      	 */
      	function regex_in_array(Array $array, $pattern)
      	{
      		if (empty($array)) return FALSE;

      		foreach($array as $item)
      		{
      			if (is_scalar($item))
      			{
      				if (preg_match($pattern, $item)) return TRUE;
      			}
      		}

      		return FALSE;
      	}
      }

      // --------------------------------------------------------------------------

      if ( ! function_exists('Query'))
      {
      	/**
      	 * Connection function
      	 *
      	 * Send an array or object as connection parameters to create a connection. If
      	 * the array or object has an 'alias' parameter, passing that string to this
      	 * function will return that connection. Passing no parameters returns the last
      	 * connection created.
      	 *
      	 * @param string|object|array $params
      	 * @return Query\Query_Builder|null
      	 */
      	function Query($params = '')
      	{
      		$cmanager = \Query\Connection_Manager::get_instance();

      		// If you are getting a previously created connection
      		if (is_scalar($params))
      		{
      			return $cmanager->get_connection($params);
      		}
      		elseif ( ! is_scalar($params) && ! is_null($params))
      		{
      			$params_object = (object) $params;

      			// Otherwise, return a new connection
      			return $cmanager->connect($params_object);
      		}
      	}
      }
      // End of common.php
      Generated using phpDox 0.8.2-dev - Copyright (C) 2010 - 2015 by Arne Blankerts
      + Size: 4,708 Bytes - Last Modified: 2015-11-10T10:13:16-05:00

      ../src/common.php

      123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225
      <?php
      /**
       * Query
       *
       * Free Query Builder / Database Abstraction Layer
       *
       * @package		Query
       * @subpackage	Core
       * @author		Timothy J. Warren
       * @copyright	Copyright (c) 2012 - 2014
       * @link 		https://github.com/aviat4ion/Query
       * @license		http://philsturgeon.co.uk/code/dbad-license
       */

      // --------------------------------------------------------------------------

      /**
       * Global functions that don't really fit anywhere else
       */

      // --------------------------------------------------------------------------

      if ( ! function_exists('do_include'))
      {
      	/**
      	 * Bulk directory loading workaround for use
      	 * with array_map and glob
      	 *
      	 * @param string $path
      	 * @return void
      	 */
      	function do_include($path)
      	{
      		require_once($path);
      	}
      }

      // --------------------------------------------------------------------------

      if ( ! function_exists('mb_trim'))
      {
      	/**
      	 * Multibyte-safe trim function
      	 *
      	 * @param string $string
      	 * @return string
      	 */
      	function mb_trim($string)
      	{
      		return preg_replace("/(^\s+)|(\s+$)/us", "", $string);
      	}
      }

      // --------------------------------------------------------------------------

      if ( ! function_exists('db_filter'))
      {
      	/**
      	 * Filter out db rows into one array
      	 *
      	 * @param array $array
      	 * @param mixed $index
      	 * @return array
      	 */
      	function db_filter($array, $index)
      	{
      		$new_array = array();

      		foreach($array as $a)
      		{
      			$new_array[] = $a[$index];
      		}

      		return $new_array;
      	}
      }

      // --------------------------------------------------------------------------

      if ( ! function_exists('from_camel_case'))
      {
      	/**
      	 * Create a snake_case string from camelCase
      	 *
      	 * @see http://stackoverflow.com/questions/1993721/how-to-convert-camelcase-to-camel-case
      	 *
      	 * @param string $input
      	 * @return string
      	 */
      	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 = strtolower($match);
      		}
      		return implode('_', $ret);
      	}
      }

      // --------------------------------------------------------------------------

      if ( ! function_exists('array_zipper'))
      {
      	/**
      	 * Zip a set of arrays together on common keys
      	 *
      	 * The $zipper_input array is an array of arrays indexed by their place in the output
      	 * array.
      	 *
      	 * @param array $zipper_input
      	 * @return array
      	 */
      	function array_zipper(Array $zipper_input)
      	{
      		$output = array();

      		foreach($zipper_input as $append_key => $values)
      		{
      			foreach($values as $index => $value)
      			{
      				if ( ! isset($output[$index]))
      				{
      					$output[$index] = array();
      				}
      				$output[$index][$append_key] = $value;
      			}
      		}

      		return $output;
      	}
      }

      // --------------------------------------------------------------------------

      if ( ! function_exists('array_pluck'))
      {
      	/**
      	 * Get an array out of an multi-dimensional array based on a common
      	 * key
      	 *
      	 * @param array $array
      	 * @param string $key
      	 * @return array
      	 */
      	function array_pluck(Array $array, $key)
      	{
      		$output = array();

      		// No point iterating over an empty array
      		if (empty($array)) return $array;

      		foreach($array as $inner_array)
      		{
      	 		if (array_key_exists($key, $inner_array))
      	 		{
      		 		$output[] = $inner_array[$key];
      	 		}
      		}

      		return $output;
      	}
      }

      // --------------------------------------------------------------------------

      if ( ! function_exists('regex_in_array'))
      {
      	/**
      	 * Determine whether a value in the passed array matches the pattern
      	 * passed
      	 *
      	 * @param array $array
      	 * @param string $pattern
      	 * @return bool
      	 */
      	function regex_in_array(Array $array, $pattern)
      	{
      		if (empty($array)) return FALSE;

      		foreach($array as $item)
      		{
      			if (is_scalar($item) && preg_match($pattern, $item))
      			{
      				return TRUE;
      			}
      		}

      		return FALSE;
      	}
      }

      // --------------------------------------------------------------------------

      if ( ! function_exists('Query'))
      {
      	/**
      	 * Connection function
      	 *
      	 * Send an array or object as connection parameters to create a connection. If
      	 * the array or object has an 'alias' parameter, passing that string to this
      	 * function will return that connection. Passing no parameters returns the last
      	 * connection created.
      	 *
      	 * @param string|object|array $params
      	 * @return Query\Query_Builder|null
      	 */
      	function Query($params = '')
      	{
      		$cmanager = \Query\ConnectionManager::get_instance();

      		// If you are getting a previously created connection
      		if (is_scalar($params))
      		{
      			return $cmanager->get_connection($params);
      		}
      		elseif ( ! is_scalar($params) && ! is_null($params))
      		{
      			$params_object = (object) $params;

      			// Otherwise, return a new connection
      			return $cmanager->connect($params_object);
      		}
      	}
      }
      // End of common.php