mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
API CHANGE: Updated throwExceptionOnBadDataType setter to be standard setThrowExceptionOnBadDataType(), added getThrowExceptionOnBadDataType().
This commit is contained in:
parent
f670576cad
commit
7de5bf55e0
@ -137,9 +137,9 @@ class GridFieldConfig_Base extends GridFieldConfig {
|
|||||||
$this->addComponent(new GridFieldDataColumns());
|
$this->addComponent(new GridFieldDataColumns());
|
||||||
$this->addComponent($pagination = new GridFieldPaginator($itemsPerPage));
|
$this->addComponent($pagination = new GridFieldPaginator($itemsPerPage));
|
||||||
|
|
||||||
$sort->throwExceptionOnBadDataType(false);
|
$sort->setThrowExceptionOnBadDataType(false);
|
||||||
$filter->throwExceptionOnBadDataType(false);
|
$filter->setThrowExceptionOnBadDataType(false);
|
||||||
$pagination->throwExceptionOnBadDataType(false);
|
$pagination->setThrowExceptionOnBadDataType(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -172,9 +172,9 @@ class GridFieldConfig_RecordEditor extends GridFieldConfig {
|
|||||||
$this->addComponent($pagination = new GridFieldPaginator($itemsPerPage));
|
$this->addComponent($pagination = new GridFieldPaginator($itemsPerPage));
|
||||||
$this->addComponent(new GridFieldDetailForm());
|
$this->addComponent(new GridFieldDetailForm());
|
||||||
|
|
||||||
$sort->throwExceptionOnBadDataType(false);
|
$sort->setThrowExceptionOnBadDataType(false);
|
||||||
$filter->throwExceptionOnBadDataType(false);
|
$filter->setThrowExceptionOnBadDataType(false);
|
||||||
$pagination->throwExceptionOnBadDataType(false);
|
$pagination->setThrowExceptionOnBadDataType(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -220,8 +220,8 @@ class GridFieldConfig_RelationEditor extends GridFieldConfig {
|
|||||||
$this->addComponent($pagination = new GridFieldPaginator($itemsPerPage));
|
$this->addComponent($pagination = new GridFieldPaginator($itemsPerPage));
|
||||||
$this->addComponent(new GridFieldDetailForm());
|
$this->addComponent(new GridFieldDetailForm());
|
||||||
|
|
||||||
$sort->throwExceptionOnBadDataType(false);
|
$sort->setThrowExceptionOnBadDataType(false);
|
||||||
$filter->throwExceptionOnBadDataType(false);
|
$filter->setThrowExceptionOnBadDataType(false);
|
||||||
$pagination->throwExceptionOnBadDataType(false);
|
$pagination->setThrowExceptionOnBadDataType(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
class GridFieldFilterHeader implements GridField_HTMLProvider, GridField_DataManipulator, GridField_ActionProvider {
|
class GridFieldFilterHeader implements GridField_HTMLProvider, GridField_DataManipulator, GridField_ActionProvider {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* See {@link throwExceptionOnBadDataType()}
|
* See {@link setThrowExceptionOnBadDataType()}
|
||||||
*/
|
*/
|
||||||
protected $throwExceptionOnBadDataType = true;
|
protected $throwExceptionOnBadDataType = true;
|
||||||
|
|
||||||
@ -23,9 +23,16 @@ class GridFieldFilterHeader implements GridField_HTMLProvider, GridField_DataMan
|
|||||||
* By default, this is set to true so that it's clearer what's happening, but the predefined
|
* By default, this is set to true so that it's clearer what's happening, but the predefined
|
||||||
* {@link GridFieldConfig} subclasses set this to false for flexibility.
|
* {@link GridFieldConfig} subclasses set this to false for flexibility.
|
||||||
*/
|
*/
|
||||||
public function throwExceptionOnBadDataType($throwExceptionOnBadDataType) {
|
public function setThrowExceptionOnBadDataType($throwExceptionOnBadDataType) {
|
||||||
$this->throwExceptionOnBadDataType = $throwExceptionOnBadDataType;
|
$this->throwExceptionOnBadDataType = $throwExceptionOnBadDataType;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* See {@link setThrowExceptionOnBadDataType()}
|
||||||
|
*/
|
||||||
|
public function getThrowExceptionOnBadDataType() {
|
||||||
|
return $this->throwExceptionOnBadDataType;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check that this dataList is of the right data type.
|
* Check that this dataList is of the right data type.
|
||||||
|
@ -21,7 +21,7 @@ class GridFieldPaginator implements GridField_HTMLProvider, GridField_DataManipu
|
|||||||
protected $itemClass = 'GridFieldPaginator_Row';
|
protected $itemClass = 'GridFieldPaginator_Row';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* See {@link throwExceptionOnBadDataType()}
|
* See {@link setThrowExceptionOnBadDataType()}
|
||||||
*/
|
*/
|
||||||
protected $throwExceptionOnBadDataType = true;
|
protected $throwExceptionOnBadDataType = true;
|
||||||
|
|
||||||
@ -42,9 +42,16 @@ class GridFieldPaginator implements GridField_HTMLProvider, GridField_DataManipu
|
|||||||
* By default, this is set to true so that it's clearer what's happening, but the predefined
|
* By default, this is set to true so that it's clearer what's happening, but the predefined
|
||||||
* {@link GridFieldConfig} subclasses set this to false for flexibility.
|
* {@link GridFieldConfig} subclasses set this to false for flexibility.
|
||||||
*/
|
*/
|
||||||
public function throwExceptionOnBadDataType($throwExceptionOnBadDataType) {
|
public function setThrowExceptionOnBadDataType($throwExceptionOnBadDataType) {
|
||||||
$this->throwExceptionOnBadDataType = $throwExceptionOnBadDataType;
|
$this->throwExceptionOnBadDataType = $throwExceptionOnBadDataType;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* See {@link setThrowExceptionOnBadDataType()}
|
||||||
|
*/
|
||||||
|
public function getThrowExceptionOnBadDataType() {
|
||||||
|
return $this->throwExceptionOnBadDataType;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check that this dataList is of the right data type.
|
* Check that this dataList is of the right data type.
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
class GridFieldSortableHeader implements GridField_HTMLProvider, GridField_DataManipulator, GridField_ActionProvider {
|
class GridFieldSortableHeader implements GridField_HTMLProvider, GridField_DataManipulator, GridField_ActionProvider {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* See {@link throwExceptionOnBadDataType()}
|
* See {@link setThrowExceptionOnBadDataType()}
|
||||||
*/
|
*/
|
||||||
protected $throwExceptionOnBadDataType = true;
|
protected $throwExceptionOnBadDataType = true;
|
||||||
|
|
||||||
@ -23,9 +23,16 @@ class GridFieldSortableHeader implements GridField_HTMLProvider, GridField_DataM
|
|||||||
* By default, this is set to true so that it's clearer what's happening, but the predefined
|
* By default, this is set to true so that it's clearer what's happening, but the predefined
|
||||||
* {@link GridFieldConfig} subclasses set this to false for flexibility.
|
* {@link GridFieldConfig} subclasses set this to false for flexibility.
|
||||||
*/
|
*/
|
||||||
public function throwExceptionOnBadDataType($throwExceptionOnBadDataType) {
|
public function setThrowExceptionOnBadDataType($throwExceptionOnBadDataType) {
|
||||||
$this->throwExceptionOnBadDataType = $throwExceptionOnBadDataType;
|
$this->throwExceptionOnBadDataType = $throwExceptionOnBadDataType;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* See {@link setThrowExceptionOnBadDataType()}
|
||||||
|
*/
|
||||||
|
public function getThrowExceptionOnBadDataType() {
|
||||||
|
return $this->throwExceptionOnBadDataType;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check that this dataList is of the right data type.
|
* Check that this dataList is of the right data type.
|
||||||
|
@ -36,9 +36,9 @@ class GridFieldTest extends SapphireTest {
|
|||||||
$pagination = new GridFieldPaginator(),
|
$pagination = new GridFieldPaginator(),
|
||||||
new GridState_Component(),
|
new GridState_Component(),
|
||||||
));
|
));
|
||||||
$sort->throwExceptionOnBadDataType(false);
|
$sort->setThrowExceptionOnBadDataType(false);
|
||||||
$filter->throwExceptionOnBadDataType(false);
|
$filter->setThrowExceptionOnBadDataType(false);
|
||||||
$pagination->throwExceptionOnBadDataType(false);
|
$pagination->setThrowExceptionOnBadDataType(false);
|
||||||
|
|
||||||
$this->assertEquals($expectedComponents, $obj->getConfig()->getComponents(), 'Testing default Config');
|
$this->assertEquals($expectedComponents, $obj->getConfig()->getComponents(), 'Testing default Config');
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user