mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
MINOR: Boundary condition check in TableListField for more helpful errors. (from r95543)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@98088 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
bd46a95c85
commit
ef0b9be1da
@ -403,16 +403,31 @@ JS
|
||||
*
|
||||
* @param $query SS_Query
|
||||
*/
|
||||
function setCustomQuery($query) {
|
||||
$this->customQuery = $query;
|
||||
function setCustomQuery(SQLQuery $query) {
|
||||
// The type-hinting above doesn't seem to work consistently
|
||||
if($query instanceof SQLQuery) {
|
||||
$this->customQuery = $query;
|
||||
} else {
|
||||
user_error('TableList::setCustomQuery() should be passed a SQLQuery', E_USER_WARNING);
|
||||
}
|
||||
}
|
||||
|
||||
function setCustomCsvQuery($query) {
|
||||
$this->customCsvQuery = $query;
|
||||
function setCustomCsvQuery(SQLQuery $query) {
|
||||
// The type-hinting above doesn't seem to work consistently
|
||||
if($query instanceof SQLQuery) {
|
||||
$this->customCsvQuery = $query;
|
||||
} else {
|
||||
user_error('TableList::setCustomCsvQuery() should be passed a SQLQuery', E_USER_WARNING);
|
||||
}
|
||||
}
|
||||
|
||||
function setCustomSourceItems($items) {
|
||||
$this->customSourceItems = $items;
|
||||
function setCustomSourceItems(DataObjectSet $items) {
|
||||
// The type-hinting above doesn't seem to work consistently
|
||||
if($items instanceof DataObjectSet) {
|
||||
$this->customSourceItems = $items;
|
||||
} else {
|
||||
user_error('TableList::setCustomSourceItems() should be passed a DataObjectSet', E_USER_WARNING);
|
||||
}
|
||||
}
|
||||
|
||||
function sourceItems() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user