Skip to content

Commit e58acb4

Browse files
trichinsmarkstory
authored andcommitted
Add 3 abstract methods to Cake\Database\Driver
1 parent 757ca35 commit e58acb4

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

Cake/Database/Driver.php

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,39 @@ public function supportsQuoting() {
143143
return true;
144144
}
145145

146+
/**
147+
* Returns a callable function that will be used to transform a passed Query object.
148+
* This function, in turn, will return an instance of a Query object that has been
149+
* transformed to accommodate any specificities of the SQL dialect in use.
150+
*
151+
* @param string $type the type of query to be transformed
152+
* (select, insert, update, delete)
153+
* @return callable
154+
*/
155+
public abstract function queryTranslator($type);
156+
157+
/**
158+
* Get the schema dialect.
159+
*
160+
* Used by Cake\Schema package to reflect schema and
161+
* generate schema.
162+
*
163+
* If all the tables that use this Driver specify their
164+
* own schemas, then this may return null.
165+
*
166+
* @return Cake\Database\Schema\BaseSchema
167+
*/
168+
public abstract function schemaDialect();
169+
170+
/**
171+
* Quotes a database identifier (a column name, table name, etc..) to
172+
* be used safely in queries without the risk of using reserver words
173+
*
174+
* @param string $identifier
175+
* @return string
176+
*/
177+
public abstract function quoteIdentifier($identifier);
178+
146179
/**
147180
* Escapes values for use in schema definitions.
148181
*

0 commit comments

Comments
 (0)