propel-adapter
[ class tree: propel-adapter ] [ index: propel-adapter ] [ all elements ]

Class: DBAdapter

Source Location: /adapter/DBAdapter.php

Class Overview


DBAdapter</code> defines the interface for a Propel database adapter.


Author(s):

Version:

  • $Revision: 563 $

Constants

Methods


Child classes:

DBOracle
Oracle adapter.
DBMySQL
This is used in order to connect to a MySQL database.
DBSybase
This is used to connect to a Sybase database.
DBSQLite
This is used in order to connect to a SQLite database.
DBNone
This DatabaseHandler is used when you do not have a database installed.
DBPostgres
This is used to connect to PostgresQL databases.

Class Details

[line 44]
DBAdapter</code> defines the interface for a Propel database adapter.

Support for new databases is added by subclassing

and implementing its abstract interface, and by registering the new database adapter and corresponding Creole driver in the private adapters map (array) in this class.

The Propel database adapters exist to present a uniform interface to database access across all available databases. Once the necessary adapters have been written and configured, transparent swapping of databases is theoretically supported with zero code change and minimal configuration file modifications.




Tags:

author:  Hans Lellelid <hans@xmpl.org> (Propel)
author:  Daniel Rall <dlr@finemaltcoding.com> (Torque)
author:  Jon S. Stevens <jon@latchkey.com> (Torque)
author:  Brett McLaughlin <bmclaugh@algx.net> (Torque)
version:  $Revision: 563 $
abstract:  


[ Top ]


Class Methods


static method factory [line 74]

static DBAdapter factory( string $driver)

Creates a new instance of the database adapter associated with the specified Creole driver.



Tags:

return:  An instance of a Propel database adapter.
throws:  PropelException if the adapter could not be instantiated.
access:  public


Parameters:

string   $driver   The name of the Propel/Creole driver to create a new adapter instance for or a shorter form adapter key.

[ Top ]

method applyLimit [line 264]

void applyLimit( &$sql, $offset, $limit)

Modifies the passed-in SQL to add LIMIT and/or OFFSET.



Tags:

abstract:  
access:  public


Overridden in child classes as:

DBOracle::applyLimit()
DBMySQL::applyLimit()
DBMSSQL::applyLimit()
Simulated Limit/Offset This rewrites the $sql query to apply the offset and limit.
DBSQLite::applyLimit()
DBPostgres::applyLimit()

Parameters:

   &$sql  
   $offset  
   $limit  

[ Top ]

method concatString [line 153]

string concatString( string $s1, string $s2)

Returns SQL which concatenates the second string to the first.



Tags:

abstract:  
access:  public


Overridden in child classes as:

DBOracle::concatString()
Returns SQL which concatenates the second string to the first.
DBMySQL::concatString()
Returns SQL which concatenates the second string to the first.
DBSybase::concatString()
Returns SQL which concatenates the second string to the first.
DBSQLite::concatString()
Returns SQL which concatenates the second string to the first.
DBNone::concatString()
Returns SQL which concatenates the second string to the first.
DBPostgres::concatString()
Returns SQL which concatenates the second string to the first.

Parameters:

string   $s1   String to concatenate.
string   $s2   String to append.

[ Top ]

method getDateFormatter [line 233]

string getDateFormatter( )

Returns date formatter string for use in date() function.



Tags:

access:  public


[ Top ]

method getId [line 215]

mixed getId( $con, [ $name = null])

Gets the generated ID (either last ID for autoincrement or next sequence ID).



Tags:

access:  public


Overridden in child classes as:

DBOracle::getId()
DBPostgres::getId()
Gets ID for specified sequence name.

Parameters:

PDO   $con  
   $name  

[ Top ]

method getIdMethod [line 188]

int getIdMethod( )

Returns the native ID method for this RDBMS.



Tags:

return:  one of DBAdapter:ID_METHOD_SEQUENCE, DBAdapter::ID_METHOD_AUTOINCREMENT.
access:  protected


Overridden in child classes as:

DBOracle::getIdMethod()
DBPostgres::getIdMethod()

[ Top ]

method getStringDelimiter [line 119]

string getStringDelimiter( )

Returns the character used to indicate the beginning and end of a piece of text used in a SQL statement (generally a single quote).



Tags:

return:  The text delimeter.
access:  public


[ Top ]

method getTimeFormatter [line 242]

string getTimeFormatter( )

Returns time formatter string for use in date() function.



Tags:

access:  public


Overridden in child classes as:

DBPostgres::getTimeFormatter()
Returns timestamp formatter string for use in date() function.

[ Top ]

method getTimestampFormatter [line 224]

string getTimestampFormatter( )

Returns timestamp formatter string for use in date() function.



Tags:

access:  public


Overridden in child classes as:

DBPostgres::getTimestampFormatter()
Returns timestamp formatter string for use in date() function.

[ Top ]

method ignoreCase [line 130]

string ignoreCase( string $in)

This method is used to ignore case.



Tags:

return:  The string in a case that can be ignored.
abstract:  
access:  public


Overridden in child classes as:

DBOracle::ignoreCase()
This method is used to ignore case.
DBMySQL::ignoreCase()
This method is used to ignore case.
DBSybase::ignoreCase()
This method is used to ignore case.
DBSQLite::ignoreCase()
This method is used to ignore case.
DBNone::ignoreCase()
This method is used to ignore case.
DBPostgres::ignoreCase()
This method is used to ignore case.

Parameters:

string   $in   The string whose case to ignore.

[ Top ]

method ignoreCaseInOrderBy [line 141]

string ignoreCaseInOrderBy( string $in)

This method is used to ignore case in an ORDER BY clause.

Usually it is the same as ignoreCase, but some databases (Interbase for example) does not use the same SQL in ORDER BY and other clauses.




Tags:

return:  The string in a case that can be ignored.
access:  public


Parameters:

string   $in   The string whose case to ignore.

[ Top ]

method initConnection [line 93]

void initConnection( $con, $settings)

This method is called after a connection was created to run necessary post-initialization queries or code.

This base method runs queries specified using the "query" setting.




Tags:

access:  public


Overridden in child classes as:

DBMySQL::initConnection()
This method is called after a connection was created to run necessary post-initialization queries or code.

Parameters:

PDO   $con   A PDO connection instance.
array   $settings   An array of settings.

[ Top ]

method isGetIdAfterInsert [line 206]

boolean isGetIdAfterInsert( )

Whether this adapter uses an ID generation system that requires getting ID _before_ performing INSERT.



Tags:

access:  public


[ Top ]

method isGetIdBeforeInsert [line 197]

boolean isGetIdBeforeInsert( )

Whether this adapter uses an ID generation system that requires getting ID _before_ performing INSERT.



Tags:

access:  public


[ Top ]

method quoteIdentifier [line 179]

string quoteIdentifier( string $text)

Quotes database objec identifiers (table names, col names, sequences, etc.).



Tags:

return:  The quoted identifier.
access:  public


Overridden in child classes as:

DBMySQL::quoteIdentifier()
DBSybase::quoteIdentifier()
DBSQLite::quoteIdentifier()

Parameters:

string   $text   The identifier to quote.

[ Top ]

method random [line 266]

void random( [ $seed = NULL])



Tags:

abstract:  
access:  public


Overridden in child classes as:

DBOracle::random()
DBMySQL::random()
DBSybase::random()
DBMSSQL::random()
DBSQLite::random()
DBPostgres::random()

Parameters:

   $seed  

[ Top ]

method strLength [line 171]

string strLength( string $s)

Returns SQL which calculates the length (in chars) of a string.



Tags:

abstract:  
access:  public


Overridden in child classes as:

DBOracle::strLength()
Returns SQL which calculates the length (in chars) of a string.
DBMySQL::strLength()
Returns SQL which calculates the length (in chars) of a string.
DBSybase::strLength()
Returns SQL which calculates the length (in chars) of a string.
DBSQLite::strLength()
Returns SQL which calculates the length (in chars) of a string.
DBNone::strLength()
Returns SQL which calculates the length (in chars) of a string.
DBPostgres::strLength()
Returns SQL which calculates the length (in chars) of a string.

Parameters:

string   $s   String to calculate length of.

[ Top ]

method subString [line 163]

string subString( string $s, int $pos, int $len)

Returns SQL which extracts a substring.



Tags:

abstract:  
access:  public


Overridden in child classes as:

DBOracle::subString()
Returns SQL which extracts a substring.
DBMySQL::subString()
Returns SQL which extracts a substring.
DBSybase::subString()
Returns SQL which extracts a substring.
DBSQLite::subString()
Returns SQL which extracts a substring.
DBNone::subString()
Returns SQL which extracts a substring.
DBPostgres::subString()
Returns SQL which extracts a substring.

Parameters:

string   $s   String to extract from.
int   $pos   Offset to start from.
int   $len   Number of characters to extract.

[ Top ]

method toUpperCase [line 110]

string toUpperCase( string $in)

This method is used to ignore case.



Tags:

return:  The upper case string.
abstract:  
access:  public


Overridden in child classes as:

DBOracle::toUpperCase()
This method is used to ignore case.
DBMySQL::toUpperCase()
This method is used to ignore case.
DBSybase::toUpperCase()
This method is used to ignore case.
DBSQLite::toUpperCase()
This method is used to ignore case.
DBNone::toUpperCase()
This method is used to ignore case.
DBPostgres::toUpperCase()
This method is used to ignore case.

Parameters:

string   $in   The string to transform to upper case.

[ Top ]

method useQuoteIdentifier [line 257]

boolean useQuoteIdentifier( )

Should Column-Names get identifiers for inserts or updates.

By default false is returned -> backwards compability.

it`s a workaround...!!!




Tags:

deprecated:  
todo:  should be abstract
access:  public


Overridden in child classes as:

DBMySQL::useQuoteIdentifier()

[ Top ]


Class Constants

ID_METHOD_AUTOINCREMENT =  1

[line 47]


[ Top ]

ID_METHOD_NONE =  0

[line 46]


[ Top ]

ID_METHOD_SEQUENCE =  2

[line 48]


[ Top ]



Documentation generated on Thu, 22 Nov 2007 03:33:40 +0000 by phpDocumentor 1.4.0