thrownewDoctrine_Connection_Exception('You must create your Doctrine_Connection by using a valid Doctrine style dsn in order to use the create/drop database functionality');
}
$info=$this->getManager()->parseDsn($dsn);
$this->export->createDatabase($info['database']);
return'Successfully created database for connection "'.$this->getName().'" at path "'.$info['database'].'"';
}catch(Exception$e){
return$e;
}
}
/**
* dropDatabase
*
* @return void
*/
publicfunctiondropDatabase()
{
try{
if(!$dsn=$this->getOption('dsn')){
thrownewDoctrine_Connection_Exception('You must create your Doctrine_Connection by using a valid Doctrine style dsn in order to use the create/drop database functionality');
}
$info=$this->getManager()->parseDsn($dsn);
$this->export->dropDatabase($info['database']);
return'Successfully dropped database for connection "'.$this->getName().'" at path "'.$info['database'].'"';
* @param integer $column The 0-indexed column in the result set.
*
* @return array Associative meta data array with the following structure:
*
* native_type The PHP native type used to represent the column value.
* driver:decl_ type The SQL type used to represent the column value in the database. If the column in the result set is the result of a function, this value is not returned by PDOStatement->getColumnMeta().
* flags Any flags set for this column.
* name The name of this column as returned by the database.
* len The length of this column. Normally -1 for types other than floating point decimals.
* precision The numeric precision of this column. Normally 0 for types other than floating point decimals.
* pdo_type The type of this column as represented by the PDO::PARAM_* constants.
*/
publicfunctiongetColumnMeta($column)
{
return$this->_stmt->getColumnMeta($column);
}
/**
* Advances to the next rowset in a multi-rowset statement handle
*
* Some database servers support stored procedures that return more than one rowset
* (also known as a result set). The nextRowset() method enables you to access the second
* and subsequent rowsets associated with a PDOStatement object. Each rowset can have a
* different set of columns from the preceding rowset.
*
* @return boolean Returns TRUE on success or FALSE on failure.
*/
publicfunctionnextRowset()
{
return$this->_stmt->nextRowset();
}
/**
* rowCount() returns the number of rows affected by the last DELETE, INSERT, or UPDATE statement
* executed by the corresponding object.
*
* If the last SQL statement executed by the associated Statement object was a SELECT statement,
* some databases may return the number of rows returned by that statement. However,
* this behaviour is not guaranteed for all databases and should not be
* relied on for portable applications.
*
* @return integer Returns the number of rows.
*/
publicfunctionrowCount()
{
return$this->_stmt->rowCount();
}
/**
* Set a statement attribute
*
* @param integer $attribute
* @param mixed $value the value of given attribute
* @return boolean Returns TRUE on success or FALSE on failure.