Class: Doctrine_Connection_Mysql

Source Location: /Doctrine/Connection/Mysql.php

Class Doctrine_Connection_Mysql

Class Overview

Doctrine_Connection_Mysql

Located in /Doctrine/Connection/Mysql.php [line 34]

Doctrine_Object
   |
   --Doctrine_Configurable
      |
      --Doctrine_Connection
         |
         --Doctrine_Connection_Common
            |
            --Doctrine_Connection_Mysql
Author(s): Information Tags:
Version:  $Revision: 1773 $
Link:  www.phpdoctrine.com
Since:  1.0
License:  LGPL

Properties

Methods

[ Top ]
Inherited Properties, Constants, and Methods
Inherited Properties Inherited Methods Inherited Constants

Inherited From Doctrine_Connection

Doctrine_Connection::$availableDrivers
Doctrine_Connection::$dbh
Doctrine_Connection::$isConnected
Doctrine_Connection::$modules
Doctrine_Connection::$options
Doctrine_Connection::$pendingAttributes
Doctrine_Connection::$properties
Doctrine_Connection::$serverInfo
Doctrine_Connection::$supported
Doctrine_Connection::$tables
Doctrine_Connection::$_count

Inherited From Doctrine_Configurable

Doctrine_Configurable::$attributes
Doctrine_Configurable::$parent
Doctrine_Configurable::$_impl

Inherited From Doctrine_Object

Doctrine_Object::$_null

Inherited From Doctrine_Connection_Common

Doctrine_Connection_Common::modifyLimitQuery()
Adds an driver-specific LIMIT clause to the query

Inherited From Doctrine_Connection

Doctrine_Connection::__construct()
the constructor
Doctrine_Connection::addTable()
addTable adds a Doctrine_Table object into connection registry
Doctrine_Connection::beginTransaction()
beginTransaction Start a transaction or set a savepoint.
Doctrine_Connection::clear()
clear clears all repositories
Doctrine_Connection::close()
close closes the connection
Doctrine_Connection::commit()
commit Commit the database changes done during a transaction that is in progress or release a savepoint. This function may only be called when auto-committing is disabled, otherwise it will fail.
Doctrine_Connection::connect()
connect connects into database
Doctrine_Connection::convertBooleans()
convertBooleans some drivers need the boolean values to be converted into integers when using DQL API
Doctrine_Connection::count()
returns the count of initialized table objects
Doctrine_Connection::create()
create creates a record
Doctrine_Connection::driverName()
converts given driver name
Doctrine_Connection::errorCode()
errorCode Fetch the SQLSTATE associated with the last operation on the database handle
Doctrine_Connection::errorInfo()
errorInfo Fetch extended error information associated with the last operation on the database handle
Doctrine_Connection::evictTables()
evictTables evicts all tables
Doctrine_Connection::exec()
exec
Doctrine_Connection::execute()
execute
Doctrine_Connection::fetchAll()
fetchAll
Doctrine_Connection::fetchArray()
fetchArray
Doctrine_Connection::fetchAssoc()
fetchAssoc
Doctrine_Connection::fetchBoth()
fetchBoth
Doctrine_Connection::fetchColumn()
fetchColumn
Doctrine_Connection::fetchOne()
fetchOne
Doctrine_Connection::fetchRow()
fetchRow
Doctrine_Connection::flush()
flush saves all the records from all tables this operation is isolated using a transaction
Doctrine_Connection::getAttribute()
getAttribute retrieves a database connection attribute
Doctrine_Connection::getAvailableDrivers()
returns an array of available PDO drivers
Doctrine_Connection::getDbh()
returns the database handler of which this connection uses
Doctrine_Connection::getIterator()
returns an iterator that iterators through all initialized table objects
Doctrine_Connection::getManager()
returns the manager that created this connection
Doctrine_Connection::getName()
getName returns the name of this driver
Doctrine_Connection::getTable()
returns a table object for given component name
Doctrine_Connection::getTables()
returns an array of all initialized tables
Doctrine_Connection::getTransactionLevel()
get the current transaction nesting level
Doctrine_Connection::hasTable()
hasTable whether or not this connection has table $name initialized
Doctrine_Connection::incrementQueryCount()
Doctrine_Connection::insert()
Inserts a table row with specified data.
Doctrine_Connection::lastInsertId()
lastInsertId
Doctrine_Connection::prepare()
prepare
Doctrine_Connection::query()
query queries the database using Doctrine Query Language returns a collection of Doctrine_Record objects
Doctrine_Connection::queryOne()
query queries the database using Doctrine Query Language and returns the first record found
Doctrine_Connection::quote()
quote quotes given input parameter
Doctrine_Connection::quoteIdentifier()
Quote a string so it can be safely used as a table or column name
Doctrine_Connection::replace()
Execute a SQL REPLACE query. A REPLACE query is identical to a INSERT query, except that if there is already a row in the table with the same key field values, the REPLACE query just updates its values instead of inserting a new row.
Doctrine_Connection::rethrowException()
rethrowException
Doctrine_Connection::rollback()
rollback
Doctrine_Connection::select()
queries the database with limit and offset added to the query and returns a PDOStatement object
Doctrine_Connection::setAttribute()
setAttribute sets an attribute
Doctrine_Connection::setCharset()
Set the charset on the current connection
Doctrine_Connection::setDateFormat()
Set the date/time format for the current connection
Doctrine_Connection::standaloneQuery()
standaloneQuery
Doctrine_Connection::supports()
supports
Doctrine_Connection::__get()
__get lazy loads given module and returns it
Doctrine_Connection::__toString()
returns a string representation of this object

Inherited From Doctrine_Configurable

Doctrine_Configurable::addListener()
addListener
Doctrine_Configurable::addRecordListener()
addRecordListener
Doctrine_Configurable::getAttribute()
returns the value of an attribute
Doctrine_Configurable::getAttributes()
getAttributes returns all attributes as an array
Doctrine_Configurable::getCacheDriver()
getCacheDriver
Doctrine_Configurable::getImpl()
getImpl returns the implementation for given class
Doctrine_Configurable::getListener()
getListener
Doctrine_Configurable::getParent()
getParent returns the parent of this component
Doctrine_Configurable::getRecordListener()
getListener
Doctrine_Configurable::setAttribute()
setAttribute sets a given attribute
Doctrine_Configurable::setEventListener()
Doctrine_Configurable::setImpl()
setImpl binds given class to given template name
Doctrine_Configurable::setListener()
setListener
Doctrine_Configurable::setParent()
sets a parent for this configurable component the parent must be configurable component itself
Doctrine_Configurable::setRecordListener()
setListener

Inherited From Doctrine_Object

Doctrine_Object::getNullObject()
getNullObject returns the null object associated with this object
Doctrine_Object::initNullObject()
initNullObject initializes the null object

[ Top ]
Property Summary
string   $driverName  

[ Top ]
Method Summary
Doctrine_Connection_Mysql   __construct()   the constructor
integer   replace()   Execute a SQL REPLACE query. A REPLACE query is identical to a INSERT query, except that if there is already a row in the table with the same key field values, the REPLACE query just updates its values instead of inserting a new row.
void   setCharset()   Set the charset on the current connection

[ Top ]
Properties
string   $driverName = 'Mysql' [line 39]
API Tags:
Access:  protected


Redefinition of:
Doctrine_Connection::$driverName

[ Top ]
Methods
Constructor __construct  [line 46]

  Doctrine_Connection_Mysql __construct( Doctrine_Manager $manager, PDO|Doctrine_Adapter $adapter  )

the constructor

Parameters:
Doctrine_Manager   $manager: 
PDO|Doctrine_Adapter   $adapter:  database handler

API Tags:
Access:  public


Redefinition of:
Doctrine_Connection::__construct()
the constructor

[ Top ]
replace  [line 167]

  integer replace( string $table, $fields, $keys  )

Execute a SQL REPLACE query. A REPLACE query is identical to a INSERT query, except that if there is already a row in the table with the same key field values, the REPLACE query just updates its values instead of inserting a new row.

The REPLACE type of query does not make part of the SQL standards. Since practically only MySQL implements it natively, this type of query is emulated through this method for other DBMS using standard types of queries inside a transaction to assure the atomicity of the operation.

Parameters:
string   $table:  name of the table on which the REPLACE query will be executed.
array   $fields: 

associative array that describes the fields and the values that will be inserted or updated in the specified table. The indexes of the array are the names of all the fields of the table. The values of the array are also associative arrays that describe the values and other properties of the table fields.

Here follows a list of field properties that need to be specified:

value: Value to be assigned to the specified field. This value may be of specified in database independent type format as this function can perform the necessary datatype conversions.

Default: this property is required unless the Null property is set to 1.

type Name of the type of the field. Currently, all types Metabase are supported except for clob and blob.

Default: no type conversion

null Boolean property that indicates that the value for this field should be set to null.

The default value for fields missing in INSERT queries may be specified the definition of a table. Often, the default value is already null, but since the REPLACE may be emulated using an UPDATE query, make sure that all fields of the table are listed in this function argument array.

Default: 0

key Boolean property that indicates that this field should be handled as a primary key or at least as part of the compound unique index of the table that will determine the row that will updated if it exists or inserted a new row otherwise.

This function will fail if no key field is specified or if the value of a key field is set to null because fields that are part of unique index they may not be null.

Default: 0

array   $keys: 

API Tags:
Return:  the number of affected rows
Access:  public


Redefinition of:
Doctrine_Connection::replace()
Execute a SQL REPLACE query. A REPLACE query is identical to a INSERT query, except that if there is already a row in the table with the same key field values, the REPLACE query just updates its values instead of inserting a new row.

[ Top ]
setCharset  [line 98]

  void setCharset( string $charset  )

Set the charset on the current connection

Parameters:
string   $charset:  charset

API Tags:
Access:  public


Redefinition of:
Doctrine_Connection::setCharset()
Set the charset on the current connection

[ Top ]