From e58acb4478e96cc35fbbb5834af28ba4657c5c4a Mon Sep 17 00:00:00 2001 From: Trevan Richins Date: Mon, 6 Jan 2014 06:39:18 -0800 Subject: [PATCH] Add 3 abstract methods to Cake\Database\Driver --- Cake/Database/Driver.php | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/Cake/Database/Driver.php b/Cake/Database/Driver.php index 3e14e27e020..03203e4b84f 100644 --- a/Cake/Database/Driver.php +++ b/Cake/Database/Driver.php @@ -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. *