FIX make augmentSQL API consistent for strict PHP

This references silverstripe/silverstripe-translatable#113
For that issue, we needed to have the DataQuery as the second parameter to
DataQuery's augmentSQL call.  Fortunately, DataQuery was already passing this
argument.  However, where the function was defined in DataExtension, the
argument was not present.  Thus, subclasses of DataExtension could not add the
parameter to their function signature if they were running in PHP strict mode
because PHP will complain that the signatures don't match.
This commit is contained in:
Jeremy Thomerson 2013-05-31 19:24:12 +00:00
parent 5d97f615ce
commit ab40dcc0ca
2 changed files with 2 additions and 2 deletions

View File

@ -42,7 +42,7 @@ abstract class DataExtension extends Extension {
*
* @param SQLQuery $query Query to augment.
*/
public function augmentSQL(SQLQuery &$query) {
public function augmentSQL(SQLQuery &$query, DataQuery &$dataQuery = null) {
}
/**

View File

@ -38,7 +38,7 @@ class Hierarchy extends DataExtension {
*/
private static $node_threshold_leaf = 250;
public function augmentSQL(SQLQuery &$query) {
public function augmentSQL(SQLQuery &$query, DataQuery &$dataQuery = null) {
}
public function augmentDatabase() {