|
Doctrine 1.2.4
|
Inherits Doctrine_Connection_Common.
Public Member Functions | |
| __get ($name) | |
| __toString () | |
| addListener ($listener, $name=null) | |
| addRecordListener ($listener, $name=null) | |
| addTable (Doctrine_Table $table) | |
| beginTransaction ($savepoint=null) | |
| bind ($name, $resource) | |
| clear () | |
| close () | |
| commit ($savepoint=null) | |
| connect () | |
| convertBooleans ($item) | |
| count () | |
| create ($name) | |
| createDatabase () | |
| createQuery () | |
| delete (Doctrine_Table $table, array $identifier) | |
| driverName ($name) | |
| dropDatabase () | |
| errorCode () | |
| errorInfo () | |
| evictTables () | |
| exec ($query, array $params=array()) | |
| execute ($query, array $params=array()) | |
| fetchAll ($statement, array $params=array()) | |
| fetchArray ($statement, array $params=array()) | |
| fetchAssoc ($statement, array $params=array()) | |
| fetchBoth ($statement, array $params=array()) | |
| fetchColumn ($statement, array $params=array(), $colnum=0) | |
| fetchOne ($statement, array $params=array(), $colnum=0) | |
| fetchRow ($statement, array $params=array()) | |
| flush () | |
| generateUniqueIndexName ($tableName, $fields) | |
| generateUniqueRelationForeignKeyName (Doctrine_Relation $relation) | |
| getAttribute ($attribute) | |
| getAttributes () | |
| getCharset () | |
| getCollate () | |
| getDbh () | |
| getDriverName () | |
| getImpl ($template) | |
| getIterator () | |
| getListener () | |
| getLocator () | |
| getManager () | |
| getName () | |
| getOption ($option) | |
| getOptions () | |
| getParent () | |
| getQueryCacheDriver () | |
| getRecordListener () | |
| getResultCacheDriver () | |
| getTable ($name) | |
| getTables () | |
| getTmpConnection ($info) | |
| getTransactionLevel () | |
| hasTable ($name) | |
| insert (Doctrine_Table $table, array $fields) | |
| isConnected () | |
| lastInsertId ($table=null, $field=null) | |
| locate ($name) | |
| modifyLimitQuery ($query, $limit=false, $offset=false, $isManip=false) | |
| modifyLimitSubquery (Doctrine_Table $rootTable, $query, $limit=false, $offset=false, $isManip=false) | |
| prepare ($statement) | |
| query ($query, array $params=array(), $hydrationMode=null) | |
| queryOne ($query, array $params=array()) | |
| quote ($input, $type=null) | |
| quoteIdentifier ($str, $checkOption=true) | |
| quoteMultipleIdentifier ($arr, $checkOption=true) | |
| replace (Doctrine_Table $table, array $fields, array $keys) | |
| rethrowException (Exception $e, $invoker, $query=null) | |
| rollback ($savepoint=null) | |
| select ($query, $limit=0, $offset=0) | |
| serialize () | |
| setAttribute ($attribute, $value) | |
| setCharset ($charset) | |
| setCollate ($collate) | |
| setDateFormat ($format=null) | |
| setEventListener ($listener) | |
| setImpl ($template, $class) | |
| setListener ($listener) | |
| setLocator (Doctrine_Locator $locator) | |
| setName ($name) | |
| setOption ($option, $value) | |
| setParent (Doctrine_Configurable $component) | |
| setRecordListener ($listener) | |
| standaloneQuery ($query, $params=array()) | |
| supports ($feature) | |
| unserialize ($serialized) | |
| unsetAttribute ($attribute) | |
| update (Doctrine_Table $table, array $fields, array $identifier) | |
Static Public Member Functions | |
| static | getAvailableDrivers () |
| static | getNullObject () |
| static | getSupportedDrivers () |
| static | initNullObject (Doctrine_Null $null) |
Protected Attributes | |
| $_name | |
| $driverName | |
|
inherited |
__get lazy loads given module and returns it
| string | $name | the name of the module to get |
| Doctrine_Connection_Exception | if trying to get an unknown module |
Definition at line 399 of file Connection.php.
|
inherited |
returns a string representation of this object
Definition at line 1552 of file Connection.php.
|
inherited |
addListener
| Doctrine_EventListener_Interface | Doctrine_Overloadable | $listener |
Definition at line 277 of file Configurable.php.
|
inherited |
addRecordListener
| Doctrine_EventListener_Interface | Doctrine_Overloadable | $listener |
Definition at line 225 of file Configurable.php.
|
inherited |
addTable adds a Doctrine_Table object into connection registry
| $table | a Doctrine_Table object to be added into registry |
Definition at line 1176 of file Connection.php.
|
inherited |
beginTransaction Start a transaction or set a savepoint.
if trying to set a savepoint and there is no active transaction a new transaction is being started
Listeners: onPreTransactionBegin, onTransactionBegin
| string | $savepoint | name of a savepoint to set |
| Doctrine_Transaction_Exception | if the transaction fails at database level |
Definition at line 1370 of file Connection.php.
|
inherited |
bind binds a resource to a name
| string | $name | the name of the resource to bind |
| mixed | $value | the value of the resource |
Definition at line 120 of file Injectable.php.
|
inherited |
clear clears all repositories
Definition at line 1236 of file Connection.php.
|
inherited |
close closes the connection
Definition at line 1262 of file Connection.php.
|
inherited |
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.
Listeners: onPreTransactionCommit, onTransactionCommit
| string | $savepoint | name of a savepoint to release |
| Doctrine_Transaction_Exception | if the transaction fails at PDO level |
| Doctrine_Validator_Exception | if the transaction fails due to record validations |
Definition at line 1393 of file Connection.php.
|
inherited |
connect connects into database
Definition at line 453 of file Connection.php.
|
inherited |
convertBooleans some drivers need the boolean values to be converted into integers when using DQL API
This method takes care of that conversion
| array | $item |
Definition at line 762 of file Connection.php.
|
inherited |
returns the count of initialized table objects
Definition at line 1164 of file Connection.php.
|
inherited |
create creates a record
create creates a record
| string | $name | component name |
Definition at line 1195 of file Connection.php.
|
inherited |
createDatabase
Issue create database command for this instance of Doctrine_Connection
Definition at line 1424 of file Connection.php.
|
inherited |
Creates a new Doctrine_Query object that operates on this connection.
Definition at line 1205 of file Connection.php.
|
inherited |
deletes table row(s) matching the specified identifier
| Doctrine_Connection_Exception | if something went wrong at the database level |
| string | $table | The table to delete data from |
| array | $identifier | An associateve array containing identifier column-value pairs. |
Definition at line 606 of file Connection.php.
|
inherited |
|
inherited |
dropDatabase
Issue drop database command for this instance of Doctrine_Connection
Definition at line 1457 of file Connection.php.
|
inherited |
errorCode Fetch the SQLSTATE associated with the last operation on the database handle
Definition at line 1292 of file Connection.php.
|
inherited |
errorInfo Fetch extended error information associated with the last operation on the database handle
Definition at line 1305 of file Connection.php.
|
inherited |
evictTables evicts all tables
Definition at line 1250 of file Connection.php.
|
inherited |
exec
| string | $query | sql query |
| array | $params | query parameters |
Definition at line 1035 of file Connection.php.
|
inherited |
execute
| string | $query | sql query |
| array | $params | query parameters |
Definition at line 999 of file Connection.php.
|
inherited |
fetchAll
| string | $statement | sql query to be executed |
| array | $params | prepared statement params |
Definition at line 798 of file Connection.php.
|
inherited |
fetchArray
| string | $statement | sql query to be executed |
| array | $params | prepared statement params |
Definition at line 835 of file Connection.php.
|
inherited |
fetchAssoc
| string | $statement | sql query to be executed |
| array | $params | prepared statement params |
Definition at line 860 of file Connection.php.
|
inherited |
fetchBoth
| string | $statement | sql query to be executed |
| array | $params | prepared statement params |
Definition at line 872 of file Connection.php.
|
inherited |
fetchColumn
| string | $statement | sql query to be executed |
| array | $params | prepared statement params |
| int | $colnum | 0-indexed column number to retrieve |
Definition at line 848 of file Connection.php.
|
inherited |
fetchOne
| string | $statement | sql query to be executed |
| array | $params | prepared statement params |
| int | $colnum | 0-indexed column number to retrieve |
Definition at line 811 of file Connection.php.
|
inherited |
fetchRow
| string | $statement | sql query to be executed |
| array | $params | prepared statement params |
Definition at line 823 of file Connection.php.
|
inherited |
flush saves all the records from all tables this operation is isolated using a transaction
| PDOException | if something went wrong at database level |
Definition at line 1218 of file Connection.php.
|
inherited |
Get/generate unique index name for a table name and set of fields
| string | $tableName | The name of the table the index exists |
| string | $fields | The fields that makes up the index |
Definition at line 1612 of file Connection.php.
|
inherited |
Get/generate a unique foreign key name for a relationship
| Doctrine_Relation | $relation | Relation object to generate the foreign key name for |
Definition at line 1591 of file Connection.php.
|
inherited |
getAttribute retrieves a database connection attribute
| integer | $attribute |
Definition at line 281 of file Connection.php.
|
inherited |
getAttributes returns all attributes as an array
Definition at line 360 of file Configurable.php.
|
staticinherited |
returns an array of available PDO drivers
Definition at line 309 of file Connection.php.
|
inherited |
|
inherited |
|
inherited |
returns the database handler of which this connection uses
Definition at line 440 of file Connection.php.
|
inherited |
getDriverName
Gets the name of the instance driver
Definition at line 381 of file Connection.php.
|
inherited |
getImpl returns the implementation for given class
Definition at line 187 of file Configurable.php.
|
inherited |
returns an iterator that iterators through all initialized table objects
foreach ($conn as $index => $table) { print $table; // get a string representation of each table object }
Definition at line 1154 of file Connection.php.
|
inherited |
getListener
Definition at line 294 of file Configurable.php.
|
inherited |
getLocator returns the locator associated with this object
if there are no locator locally associated then this method tries to fetch the current global locator
Definition at line 75 of file Injectable.php.
|
inherited |
returns the manager that created this connection
Definition at line 430 of file Connection.php.
|
inherited |
getName returns the name of this driver
Definition at line 356 of file Connection.php.
|
staticinherited |
getNullObject returns the null object associated with this object
Definition at line 145 of file Injectable.php.
|
inherited |
getOption
Retrieves option
| string | $option |
Definition at line 254 of file Connection.php.
|
inherited |
getOptions
Get array of all options
Definition at line 241 of file Connection.php.
|
inherited |
getParent returns the parent of this component
Definition at line 423 of file Configurable.php.
|
inherited |
getQueryCacheDriver
Definition at line 1331 of file Connection.php.
|
inherited |
getListener
Definition at line 242 of file Configurable.php.
|
inherited |
getResultCacheDriver
Definition at line 1317 of file Connection.php.
|
staticinherited |
Returns an array of supported drivers by Doctrine
Definition at line 319 of file Connection.php.
|
inherited |
returns a table object for given component name
| string | $name | component name |
Definition at line 1113 of file Connection.php.
|
inherited |
returns an array of all initialized tables
Definition at line 1137 of file Connection.php.
|
inherited |
getTmpConnection
Create a temporary connection to the database with the user credentials. This is so the user can make a connection to a db server. Some dbms allow connections with no database, but some do not. In that case we have a table which is always guaranteed to exist. Mysql: 'mysql', PostgreSQL: 'postgres', etc. This value is set in the Doctrine_Export_{DRIVER} classes if required
| string | $info |
Definition at line 1496 of file Connection.php.
|
inherited |
get the current transaction nesting level
Definition at line 1281 of file Connection.php.
|
inherited |
hasTable whether or not this connection has table $name initialized
| mixed | $name |
Definition at line 1102 of file Connection.php.
|
staticinherited |
initNullObject initializes the null object
| Doctrine_Null | $null |
Definition at line 134 of file Injectable.php.
|
inherited |
Inserts a table row with specified data.
| Doctrine_Table | $table | The table to insert data into. |
| array | $values | An associative array containing column-value pairs. Values can be strings or Doctrine_Expression instances. |
Definition at line 664 of file Connection.php.
|
inherited |
Check wherther the connection to the database has been made yet
Definition at line 229 of file Connection.php.
|
inherited |
lastInsertId
Returns the ID of the last inserted row, or the last value from a sequence object, depending on the underlying driver.
Note: This method may not return a meaningful or consistent result across different drivers, because the underlying database may not even support the notion of auto-increment fields or sequences.
| string | $table | name of the table into which a new row was inserted |
| string | $field | name of the field into which a new row was inserted |
Definition at line 1352 of file Connection.php.
|
inherited |
locate locates a resource by given name and returns it
if the resource cannot be found locally this method tries to use the global locator for finding the resource
| Doctrine_Locator_Exception | if the resource could not be found |
| string | $name | the name of the resource |
Definition at line 96 of file Injectable.php.
| Doctrine_Connection_Db2::modifyLimitQuery | ( | $query, | |
$limit = false, |
|||
$offset = false, |
|||
$isManip = false |
|||
| ) |
Adds an driver-specific LIMIT clause to the query
| string | $query | query to modify |
| integer | $limit | limit the number of rows |
| integer | $offset | start reading from given offset |
Definition at line 43 of file Db2.php.
|
inherited |
Creates dbms specific LIMIT/OFFSET SQL for the subqueries that are used in the context of the limit-subquery algorithm.
Definition at line 1542 of file Connection.php.
|
inherited |
prepare
| string | $statement |
Definition at line 908 of file Connection.php.
|
inherited |
query queries the database using Doctrine Query Language returns a collection of Doctrine_Record objects
$users = $conn->query('SELECT u.* FROM User u');
$users = $conn->query('SELECT u.* FROM User u WHERE u.name LIKE ?', array('someone'));
| string | $query | DQL query |
| array | $params | query parameters |
| int | $hydrationMode | Doctrine_Core::HYDRATE_ARRAY or Doctrine_Core::HYDRATE_RECORD |
Definition at line 894 of file Connection.php.
|
inherited |
query queries the database using Doctrine Query Language and returns the first record found
$user = $conn->queryOne('SELECT u.* FROM User u WHERE u.id = ?', array(1));
$user = $conn->queryOne('SELECT u.* FROM User u WHERE u.name LIKE ? AND u.password = ?', array('someone', 'password') );
| string | $query | DQL query |
| array | $params | query parameters |
Definition at line 951 of file Connection.php.
|
inherited |
quote quotes given input parameter
| mixed | $input | parameter to be quoted |
| string | $type |
Definition at line 775 of file Connection.php.
|
inherited |
Quote a string so it can be safely used as a table or column name
Delimiting style depends on which database driver is being used.
NOTE: just because you CAN use delimited identifiers doesn't mean you SHOULD use them. In general, they end up causing way more problems than they solve.
Portability is broken by using the following characters inside delimited identifiers:
`) – due to MySQL") – due to Oracle[ or ]) – due to AccessDelimited identifiers are known to generally work correctly under the following drivers:
InterBase doesn't seem to be able to use delimited identifiers via PHP 4. They work fine under PHP 5.
| string | $str | identifier name to be quoted |
| bool | $checkOption | check the 'quote_identifier' option |
Definition at line 722 of file Connection.php.
|
inherited |
quoteMultipleIdentifier Quotes multiple identifier strings
| array | $arr | identifiers array to be quoted |
| bool | $checkOption | check the 'quote_identifier' option |
Definition at line 743 of file Connection.php.
|
inherited |
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 and SQLIte implement it natively, this type of query isemulated through this method for other DBMS using standard types of queries inside a transaction to assure the atomicity of the operation.
| string | name of the table on which the REPLACE query will be executed. |
| array | an 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 values to be assigned to the specified field.
| array | $keys | an array containing all key fields (primary key fields or unique index fields) for this table |
the uniqueness of a row will be determined according to the provided key fields
this method will fail if no key fields are specified
| Doctrine_Connection_Exception | if this driver doesn't support replace |
| Doctrine_Connection_Exception | if some of the key values was null |
| Doctrine_Connection_Exception | if there were no key fields |
| PDOException | if something fails at PDO level @ return integer number of rows affected |
Definition at line 566 of file Connection.php.
|
inherited |
rethrowException
| Doctrine_Connection_Exception |
Definition at line 1069 of file Connection.php.
|
inherited |
rollback Cancel any database changes done during a transaction or since a specific savepoint that is in progress. This function may only be called when auto-committing is disabled, otherwise it will fail. Therefore, a new transaction is implicitly started after canceling the pending changes.
this method can be listened with onPreTransactionRollback and onTransactionRollback eventlistener methods
| string | $savepoint | name of a savepoint to rollback to |
| Doctrine_Transaction_Exception | if the rollback operation fails at database level |
Definition at line 1412 of file Connection.php.
|
inherited |
queries the database with limit and offset added to the query and returns a Doctrine_Connection_Statement object
| string | $query | |
| integer | $limit | |
| integer | $offset |
Definition at line 971 of file Connection.php.
|
inherited |
Serialize. Remove database connection(pdo) since it cannot be serialized
Definition at line 1562 of file Connection.php.
|
inherited |
setAttribute sets an attribute
| integer | $attribute | |
| mixed | $value |
Definition at line 335 of file Connection.php.
|
inherited |
|
inherited |
|
inherited |
Set the date/time format for the current connection
| string | time format |
Definition at line 787 of file Connection.php.
|
inherited |
| Doctrine_EventListener | $listener |
Definition at line 214 of file Configurable.php.
|
inherited |
setImpl binds given class to given template name
this method is the base of Doctrine dependency injection
| string | $template | name of the class template |
| string | $class | name of the class to be bound |
Definition at line 174 of file Configurable.php.
|
inherited |
setListener
| Doctrine_EventListener_Interface | Doctrine_Overloadable | $listener |
Definition at line 311 of file Configurable.php.
|
inherited |
setLocator this method can be used for setting the locator object locally
| Doctrine_Locator | the locator object |
Definition at line 60 of file Injectable.php.
|
inherited |
setName
Sets the name of the connection
| string | $name |
Definition at line 369 of file Connection.php.
|
inherited |
setOption
Set option value
| string | $option |
Definition at line 269 of file Connection.php.
|
inherited |
sets a parent for this configurable component the parent must be configurable component itself
| Doctrine_Configurable | $component |
Definition at line 412 of file Configurable.php.
|
inherited |
setListener
| Doctrine_EventListener_Interface | Doctrine_Overloadable | $listener |
Definition at line 259 of file Configurable.php.
|
inherited |
standaloneQuery
| string | $query | sql query |
| array | $params | query parameters |
Definition at line 987 of file Connection.php.
|
inherited |
supports
| string | $feature | the name of the feature |
keys representing feature names and values as one of the following (true, false, 'emulated')
Definition at line 525 of file Connection.php.
|
inherited |
Unserialize. Recreate connection from serialized content
| string | $serialized |
Definition at line 1576 of file Connection.php.
|
inherited |
Unset an attribute from this levels attributes
| integer | $attribute |
Definition at line 347 of file Configurable.php.
|
inherited |
Updates table row(s) with specified data.
| Doctrine_Connection_Exception | if something went wrong at the database level |
| Doctrine_Table | $table | The table to insert data into |
| array | $values | An associative array containing column-value pairs. Values can be strings or Doctrine_Expression instances. |
Definition at line 630 of file Connection.php.
|
protectedinherited |
|
protectedinherited |
The name of this connection driver.
Definition at line 83 of file Connection.php.