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:
Sam Minnee 2010-02-04 00:49:12 +00:00
parent bd46a95c85
commit ef0b9be1da

View File

@ -403,16 +403,31 @@ JS
*
* @param $query SS_Query
*/
function setCustomQuery($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) {
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) {
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() {