Class: Doctrine_Connection_Mysql
Source Location: /Doctrine/Connection/Mysql.phpClass Doctrine_Connection_Mysql
Doctrine_Connection_Mysql Located in /Doctrine/Connection/Mysql.php [line 34] Doctrine_Object | --Doctrine_Configurable | --Doctrine_Connection | --Doctrine_Connection_Common | --Doctrine_Connection_MysqlAuthor(s):
|
Inherited Properties | Inherited Methods | Inherited Constants |
---|---|---|
Inherited From Doctrine_Connection
Inherited From Doctrine_Configurable Inherited From Doctrine_Object |
Inherited From Doctrine_Connection_Common
Inherited From Doctrine_Connection
Inherited From Doctrine_Configurable
Inherited From Doctrine_Object
|
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 |
|
the constructor
Parameters:Doctrine_Manager | $manager: | |
PDO|Doctrine_Adapter | $adapter: | database handler |
API Tags:
Access: | public |
- Doctrine_Connection::__construct()
- the constructor
|
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 |
- 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.
|
Set the charset on the current connection
Parameters:string | $charset: | charset |
API Tags:
Access: | public |
- Doctrine_Connection::setCharset()
- Set the charset on the current connection