Skip to content

Commit

Permalink
Add 3 abstract methods to Cake\Database\Driver
Browse files Browse the repository at this point in the history
  • Loading branch information
trichins authored and markstory committed Jan 7, 2014
1 parent 757ca35 commit e58acb4
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions Cake/Database/Driver.php
Expand Up @@ -143,6 +143,39 @@ public function supportsQuoting() {
return true;
}

/**
* Returns a callable function that will be used to transform a passed Query object.
* This function, in turn, will return an instance of a Query object that has been
* transformed to accommodate any specificities of the SQL dialect in use.
*
* @param string $type the type of query to be transformed
* (select, insert, update, delete)
* @return callable
*/
public abstract function queryTranslator($type);

/**
* Get the schema dialect.
*
* Used by Cake\Schema package to reflect schema and
* generate schema.
*
* If all the tables that use this Driver specify their
* own schemas, then this may return null.
*
* @return Cake\Database\Schema\BaseSchema
*/
public abstract function schemaDialect();

/**
* Quotes a database identifier (a column name, table name, etc..) to
* be used safely in queries without the risk of using reserver words
*
* @param string $identifier
* @return string
*/
public abstract function quoteIdentifier($identifier);

/**
* Escapes values for use in schema definitions.
*
Expand Down

0 comments on commit e58acb4

Please sign in to comment.