Skip to content

Instantly share code, notes, and snippets.

@kinglozzer
Created February 16, 2017 23:14
Show Gist options
  • Save kinglozzer/59b14e2200288bb650b0ec9d308308e0 to your computer and use it in GitHub Desktop.
Save kinglozzer/59b14e2200288bb650b0ec9d308308e0 to your computer and use it in GitHub Desktop.
<?php
$dataList = $dataList->alterDataQuery(function($dataQuery) {
$selectSQL = '';
$alias = '';
// Hack - DataQuery::selectField() is protected in SilverStripe 3
// $dataQuery->selectField($selectSQL, $alias);
$reflectionMethod = new ReflectionMethod($dataQuery, 'selectField');
$reflectionMethod->setAccessible(true);
$reflectionMethod->invoke($dataQuery, $selectSQL, $alias);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment