API CHANGE: GridFieldConfig should extend object to make use of Object::create() this also fixes GridFieldConfig_RecordViewer::create() which was not working before

but don't extend Object
This commit is contained in:
Zauberfisch 2012-08-19 14:01:09 +00:00 committed by Sam Minnee
parent c738744c38
commit 70b22fa4ca

View File

@ -14,21 +14,23 @@
* - {@link GridFieldConfig_RelationEditor} * - {@link GridFieldConfig_RelationEditor}
*/ */
class GridFieldConfig { class GridFieldConfig {
/**
*
* @return GridFieldConfig
*/
public static function create(){
return new GridFieldConfig();
}
/** /**
* *
* @var ArrayList * @var ArrayList
*/ */
protected $components = null; protected $components = null;
/**
* @param mixed $arguments,... arguments to pass to the constructor
* @return GridFieldConfig
*/
public static function create() {
return call_user_func_array('Object::create', array_merge(
array(get_called_class()),
func_get_args()
));
}
/** /**
* *
*/ */
@ -131,16 +133,6 @@ class GridFieldConfig {
* with sortable and searchable headers. * with sortable and searchable headers.
*/ */
class GridFieldConfig_Base extends GridFieldConfig { class GridFieldConfig_Base extends GridFieldConfig {
/**
*
* @param int $itemsPerPage - How many items per page should show up per page
* @return GridFieldConfig_Base
*/
public static function create($itemsPerPage=null){
return new GridFieldConfig_Base($itemsPerPage);
}
/** /**
* *
* @param int $itemsPerPage - How many items per page should show up * @param int $itemsPerPage - How many items per page should show up
@ -176,16 +168,6 @@ class GridFieldConfig_RecordViewer extends GridFieldConfig_Base {
* *
*/ */
class GridFieldConfig_RecordEditor extends GridFieldConfig { class GridFieldConfig_RecordEditor extends GridFieldConfig {
/**
*
* @param int $itemsPerPage - How many items per page should show up
* @return GridFieldConfig_RecordEditor
*/
public static function create($itemsPerPage=null){
return new GridFieldConfig_RecordEditor($itemsPerPage);
}
/** /**
* *
* @param int $itemsPerPage - How many items per page should show up * @param int $itemsPerPage - How many items per page should show up
@ -225,16 +207,6 @@ class GridFieldConfig_RecordEditor extends GridFieldConfig {
* </code> * </code>
*/ */
class GridFieldConfig_RelationEditor extends GridFieldConfig { class GridFieldConfig_RelationEditor extends GridFieldConfig {
/**
*
* @param int $itemsPerPage - How many items per page should show up
* @return GridFieldConfig_RelationEditor
*/
public static function create($itemsPerPage=null){
return new GridFieldConfig_RelationEditor($itemsPerPage);
}
/** /**
* *
* @param int $itemsPerPage - How many items per page should show up * @param int $itemsPerPage - How many items per page should show up